Problem with SENDING Push notifications!

Portage .apk to .bar (apk2bar) and I need to send push messages to the device (Dev Alpha B)

but I can´t find code limit and the error of result of the sender.

This my PHP server sender:

public function sendNotificationBlackBerry ($registatoin_tokens, $message) {}
$appid = 4038-8si785997a3eir572168c5f821291rl8a84';
$password = "Ja50N4Hu1d";
$boundary = "mPsbVQo0a68eIL3OAxnm";
$appport = "33664;
$deliverbefore = gmdate ("Y - m - d\TH:i:s\Z", strtotime ('+ 2 minutes'));

An array of addresses must be in the form of PIN or "push_all".
$addresses = ";
foreach ($registatoin_tokens as $value) {}
$addresses. = '

' ;
}
Create a new cURL resource
$ch = function curl_init();
$messageid = true (true);

$data = '-'. $boundary. "\r\n".
'
http://www.openmobilealliance.org/tech/DTD/pap_2.1.DTD">

'
. $addresses.
'

' . "\r\n".
'--' . $boundary. "\r\n".
"Content-Type: text/plain". "\r\n". "
"Push-Message-ID: '." $messageid. "\r\n\r\n".
stripslashes ($message). "\r\n".
'--' . $boundary. '--' . « \n\r » ;

set the URL and other appropriate options
curl_setopt ($ch, CURLOPT_URL, "https://pushapi.eval.blackberry.com/mss/PD_pushRequest"); //Erro 2000 code request is not valid.
curl_setopt ($ch, CURLOPT_URL, "https://cpXXXX.pushapi.eval.blackberry.com/mss/PD_pushRequest"); / / Error CODE: 2000
curl_setopt ($ch, CURLOPT_URL, "https://pushapi.eval.blackberry.com"); / / not valid end of document
curl_setopt ($ch, CURLOPT_URL, "https://cpXXXX.pushapi.eval.blackberry.com"); //Invalid end of document

curl_setopt ($ch, CURLOPT_HEADER, false);
curl_setopt ($ch, CURLOPT_USERAGENT, "SAA push application");
curl_setopt ($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt ($ch, curlopt_buffersize, CURLAUTH_BASIC);
curl_setopt ($ch, CURLOPT_USERPWD, $appid. ':' . $password);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ch, CURLOPT_HTTPHEADER, array ("Content-Type: multipart/related;")) Boundary =". $boundary. "; type = application/xml"," Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q =. 2 "," connection: keep-alive "));

recovery URL and pass it to the browser
$xmldata = curl_exec;
curl_close ($ch);

//-----------------------------
Start the analysis of response output and the XML that we can read
$p = xml_parser_create();
xml_parse_into_struct ($p, $xmldata, $vals);
$errorcode = xml_get_error_code ($p);
If ($errorcode > 0) {}
$err = true;
}
xml_parser_free ($p);

echo ' Our PUSH-ID: '. $messageid. "
\n » ;
If (! $err & $vals [1] ['tag'] == 'PUSH-RESPONSE') {}
echo ' PUSH-ID: '. $vals [1] ['attributes'] ['PUSH-ID']. "
\n » ;
echo ' RESPONSE TIME: '. $vals [1] ['attributes'] ['RESPONSE TIME']. "
\n » ;
echo ' response CODE: '. $vals [2] ['attributes'] ['CODE']. "
\n » ;
echo ' response DESC: '. $vals [2] ['attributes'] ['DESC']. "
\n » ;
} else if ($err) {}
echo '

An XML parser error occurred

' . "\n";
echo '
' . xml_error_string($errorcode) . "
\n » ;
echo '

Response

' . "\n";
echo '
' . $xmldata . '
' . "\n";
} else {}
echo '

An error has occurred

' . "\n";
echo ' fault CODE: '. $vals [1] ['attributes'] ['CODE']. "
\n » ;
echo ' error DESC: '. $vals [1] ['attributes'] ['DESC']. "
\n » ;
echo '
' . $xmldata . '
' . "\n";
var_dump ($XMLDATA);
}
// -----------------------------

Return $xmldata;
}

Try adding a blank line between the "Content-Type: text/html" line and your actual payload data. It seems that the system expects all the headers to be included in the estate, then a space, then the payload.

Tags: BlackBerry Developers

Similar Questions

  • problems with CERT push notification

    Hi guys

    I thought I had created certificates OK, but I get the error message it is.

    Can someone tell me what might be causing the problem?

    Screen shot 2011-10-27 at 16.47.14.png

    I went to my App ID and created the aps_production_identity.cer file and the version of dev too.

    These were then imported into keychain and then exported in a .p12 file CERT... is that correct?

    as you paid will be able to see, the error message says "unable to find expected label ' Production IOS Apple Push Services...".

    Is there a guide for the creation of these anywhere?

    See you soon

    Alistair

    Well, if it does not work in a first time, try, try and try again. Find the latest documents of Bob, always noy sure what I did wrong! but now it works, don't think I was name the file as 'planned '.

    Need to listen to my own advice... read documents :-)

  • problems with sending/receiving messages

    For the last two weeks my iphone 6 s and my son 6 more have had problems with sending/receiving messages in the texts of the Group and regularly comes to a voicemail.  Messages are not at all or you may be able to receive them. Then last night on a group text between me and another user of iphone and a droid user messages were not all going through and an 'unknown' appeared on the screen of the droid users as if this person has attempted to send a message to our group text but nothing was there.  Iphone users could not see it.  This morning - messages still does not go through the text of the group or on one.  Any ideas?

    SMS texts are a function of carrier

    Control an upgrade of the carrier

    If the droid user used an iPhone before having them their registration number

    Also check with support carrier technique

  • Send push notification app from a php page

    Hello

    My question is: is it possible to send push notification to an application from a php page (hosted on a remote server or website)? If so, is there a tutorial or something?

    The simplest option is to use a 3rd party service which provide an API to send promissory notes and a plugin for PhoneGap. Pushwoosh.com are very good and have examples of code for php. You will need to register for service PN Apple and Google (no extra cost) then give the Panel of Pushwoosh the access key (Google) and your Apple dev password (it will configure the necessary certificates for you).

  • Problem with sending a message when you're connected via Wi - Fi

    Hello. Still getting used to my Dext (owned it for about 4 days). I noticed this morning that I can't send the mail from the POP3 account, I set up on my Dext when I am connected via Wi - Fi - when I try I get an "authentication failure". When I disable Wi - Fi email sends end. There is no problem with webmail - send although I am connected to the Wi - Fi or 3 G network.

    Anyone know how to send the mail while POP3 on the Wi - Fi network? Thanks in advance...

    Understand the problem - port incorrect settin for mail server outgoing. Changed to 587 according to some messages that I saw during a search - that did the trick!

  • Satellite A200-1A 9: problem with sending/receiving e-mail using Windows Mail

    Use Windows mail, I have to open/close the program to be able to send emails, they are entangled in the Outbox. By closing and reopening the program, mail is sent. Also the blue figure 1, supports showning 1 mail unread in the Outbox is there all the time, although there is no read or unread emails in the Outbox

    Not a problem server as all mails are go/very good reception on my desk.

    Pressing on send and receive button does not help. Although from time to time on what it will receive emails when you press send/receive, but will not send the

    I have Norton Internet security 2007 and getting fed up with the ongoing problems that seems to cause during the period 2004-7.

    Is there a problem with the running with Vista Windows mail program which is known

    I think I found a solution

    Please check this:

    Windows Mail won't send or receive emails
    http://support.toshiba-tro.de/KB0/TSB7701X30005R01.htm

    It seems that the update of the Software Desktop SMS Installer version will help to address this problem.

  • Beginning with the Push Notifications

    Hello. I'm creating an application that requires access to the push notifications. I have a few questions.

    What is the difference between BIS and BES and these are the ways of ONLY to push?

    How can I sign up to allow me to test push notifications?

    How much does it cost?

    Server code can be written in any language?

    Once my code is running, my push works for any device and carrier or are there differences?

    Can I push as much as I want to, or are there limits?

    Thanks in advance.

    pg1181 wrote:

    What is the difference between BIS and BES and these are the ways of ONLY to push?

    BIS is a public Service to push when you use the Internet of RIM infrastructure

    BES is the Push Service of the company where you are hosting your own BES server.

    good news: BES Express Server is FREE

    pg1181 wrote:

    How can I sign up to allow me to test push notifications?

    Register for the evaluation: http://us.blackberry.com/developers/platform/pushapi.jsp

    pg1181 wrote:

    How much does it cost?

    Push Services are FREE

    If you need to guarantee delivery and want to be notified, you must push more Service

    where, up to 100,000 pulses per app per day are FREE

    pg1181 wrote:

    Server code can be written in any language?

    YES

    If you can send the HTTP Messages, then it works

    pg1181 wrote:

    Once my code is running, my push works for any device and carrier or are there differences?

    YES each BlackBerry has a unique device PIN - this PIN is used to identify devices

  • Problems with sending some e-mail from abroad.

    Please bear with me on this problem as I am not very intuitive in regards to the accounts. POP, etc. etc.

    I have a system Windows 8 and use the BT Internet to send messages without any problems. But today I tried twice to send the same e-mail to a gmail account in America with two clips of very small size but in a few minutes, he returned with an error message stating that the e-mail could not be sent my e-mail address and to contact my ISP (BT). I have in the past received emails from that same address with no problems.

    I contacted BT and they checked my system and everything works fine and there is nothing else they can do, I can send other emails to colleagues in the United Kingdom without any problem.

    My wife sent a test message to the gmail address, and it was received without a problem so I'm assuming that the fault lies somewhere on my PC.

    Your help would be very appreciated.

    Hi Steve,.

    1. Your wife uses BT E-mail account to send emails?
    2. Are you facing problems with the other recipient?
    3. You use mail application?

    Please return with the required parameters so that we can better help you.

  • Problem with e-mail notifications

    We are experiencing some problems with notifications.

    Nobody in our company receives any updates trough email, although everyone has notifications and collections of e-mail activated.

    Is there a problem with emails, or do we need to configure anything else to turn the notifications?

    Hello:

    If all members of your community has problems with notifications, it can be a problem with your e-mail filters. Did you check unnecessary folders to ensure that emails are not stuck there? You may need to apply for leave IT '[email protected]' then these emails are blocked.

    Hope that helps,

    Socialcast VMware team

  • 2 problems with send/receive email

    I have an application that receives and sends emails.  When TI receives an email of interest that the email is deleted in the public papers.  It's the new message notification never goes away.  So if I get 5 emails my program needs, the message counter will be locked at 5.

    I try to set the State of the message before deleting.  With the help of:

    m.setStatus (Message.Status.TX_READ, 0);

    f.deleteMessage (m);

    I also tried to wait a short time before the deleteMessage, but still the meter counts.

    Secondly when I send a message I want to remove public newspapers after they are sent.  So I run a loop to keep control of the message to change state.  But he never does.

    If (m.getStatus () == Message.Status.TX_SENT: m.getStatus () == Message.Status.TX_DELIVERED) {}

    f.deleteMessage (m);

    Is done in another thread, and yes it is to verify, because after 15 seconds I said to drop the audit for delivery and just remove it.

    I test on a BlackBerry Pearl 8130 4.5.0.77

    This phone just not set/verification, message status values?  or am I wrong in how I'm setting/control

    I need to see your code.

    I have a commercial product that allows the same operation and I have never seen the problem you describe here.

    Now, a few caveats:

    1. in the message sink, your context is the e-mail thread (not your application). You should never keep this thread with long a sleep() or any treatment

    2. in this context, you have the message before committing the folder and before incrementing the value of message waiting.

    I think that you can be setting the message as 'open' before the Mail app increment the counter, which she will do when the message is posted to the folder without worrying. Of course, he cannot commit until it leaves your listener

    My suggestion is to send an event to your own application (from the listener), containing the message, and then allow the thread of e-mail at the exit of the listener and finish the validation of the message. Then, you can intercept the message and mark the message as open, after validation.

  • Problem with sending a fax to network folder

    I have a HP 8500 Office Jet Pro, 910g hooked to my wireless network.  I configured the printer to send faxes received to a network on my computer folder, and not to print a paper copy.  However, the printer saves only the first page of the fax in the folder and the other pages do not appear in the file.

    My computer is running Windows Vista Home Edition 32-bit. I don't get the error messages.

    Someone knows how to fix this? or is it how the HP digital fax?

    Thanks, Jim

    Hi Jim,.

    The fax is received as a TIF format and more likely to contain pages, but not just any TIFF reader supports multi-Tiff files.

    Make sure you have opened the file using the Windows Photo Viewer supporting multi-Tiff, if it does not open the default file you can click with the right button on the file and select the program from the open with menu.

    Please let me know if that can solve the problem that you are facing.

    Shlomi

  • LASERJET PRO M1536DNF - problem with send reel

    Hello

    It is a simple (or stupid) question. I just need to send several different faxes with different numbers, but I can just send a fax at the same time. There is no queue, the fax cannot store more than one fax at a time. I think that the fax is not well configured. Can someone help me?

    Thank you.

    Hi WillBTech,

    Update: the printer will do queue while the first fax sent. Here's what I discovered. When the first fax is being sent I typed in the second number, and then press the Send Fax button. The problem, I've noticed, is that you can not see the numbers that you type to the second fax as the screen is showing fax send. Once the first fax has finished the printer will return to the home screen, and then a few moments later will start the second fax that was typed in, while the first was sending. Fall down is that you must make sure that you type the second fax number without any errors. Let me know if you have the same experience?

  • problem with sending mail after sending by GET

    Hello. i've got such a problem-i can send a screenshot to the server by HTTP using the POST method like this:

              Bitmap _bitmap = new Bitmap(Display.getWidth(), Display.getHeight());
                Display.screenshot(_bitmap);
    
                JPEGEncodedImage _jpg = JPEGEncodedImage.encode(_bitmap, 20);
                DataBuffer _db = new DataBuffer();
                _db.write(_jpg.getData());
    
                _http = (HttpConnection)
                            Connector.open(_url, Connector.READ_WRITE);
    
                _http.setRequestMethod("POST");
    
                _http.openOutputStream().write(_db.toArray());
    

    and it works well. but now i need, initially, send some parameters (such as the IMEI) using GET and then this screenshot using POST (the same as in this code I do this more or less like this:)

    URLEncodedPostData _u = new URLEncodedPOstData(null, false);_u.append("imei", "123456789");   
    
        _http = (HttpConnection)
                Connector.open(_url+_u, Connector.READ_WRITE);
         DataInputStream _dis = _http.openDataInputStream(); 
    
         Bitmap _bitmap = new Bitmap(Display.getWidth(), Display.getHeight());
                Display.screenshot(_bitmap);
    
                JPEGEncodedImage _jpg = JPEGEncodedImage.encode(_bitmap, 20);
                DataBuffer _db = new DataBuffer();
                _db.write(_jpg.getData());
    
                        _http.setRequestMethod("POST");
    
                _http.openOutputStream().write(_db.toArray());
    

    but this gives me an IOException! but still even with IOException I log and server gets the imei that was sent using GET. I noticed that the problem is caused by this line:

    _HTTP.setRequestMethod ("post");

    I put it right after the connection:

    _httpConnection = (HttpConnection)Connector(_url+_u, Connector.READ_WRITE);_httpConnection.setRequestMethod("POST");
    

    now, I only get an IOException, and always the server will not get my picture. only the imei...

    Why is this? Why can I not use post after get? or what I am doing wrong?

    thx for any suggestion...

    Kind regards!

    Hi, problem solved. I have new httpConnection each time so that I could not do that. now it's ok.

    Kind regards

  • SX10 problem with sending audio with the video presentation

    I recently deployed a Cisco SX10 and found a fault, that I can't understand. When sharing content with extreme of end users, they can see the video but don't get no audio. I checked the settings and I'm confused as to what is misconfigured.

    I checked the bases, wiring, volume, and the settings in the codec it resembles a simple set up. When I introduce locally I have the same problem - no sound from the TV.

    Any ideas?

    Looking at the Guide of Installation SX10 on pg 5.  The SX10 is not an audio connector dedicated to the VGA input, since doesn't send VGA audio you need an additional input for audio.  I test using the HDMI input, and I heard audio locally and on the far - end, since HDMI will send video and audio together.

  • interesting problem with sending e-mail

    Hello world
    I faced a very interesting problem. In the code below, I want to send a variable (w_data) with the html, but the recipient do not e-mail, but when I remove the part (w_data) "BOLD" and write a string like "Gauthier", the recipient takes this e-mail. What is the problem, why I can't send a varchar2?


    DECLARE
    v_from VARCHAR2 (80): = "[email protected]";
    v_recipient VARCHAR2 (80): = "[email protected]";
    v_subject VARCHAR2 (80): = "test subject";
    v_mail_host VARCHAR2 (30): = "mail.ere.com.tr";
    v_mail_conn UTL_SMTP.connection;
    CRLF VARCHAR2 (2): = CHR (13) | CHR (10);
    CURSOR cur_
    IS
    Select disconnect_cause in the rawticket_voip;
    w_data VARCHAR2 (31000);


    BEGIN
    v_mail_conn: = UTL_SMTP.open_connection (v_mail_host, 25);
    UTL_SMTP. HELO (v_mail_conn, v_mail_host);
    UTL_SMTP.mail (v_mail_conn, v_from);
    UTL_SMTP. RCPT (v_mail_conn, v_recipient);


    w_data: = ' < html >
    < table border = "1" >
    < tr bgcolor = 'Light Blue' > ';
    FOR C IN CUR_ LOOP
    W_DATA: = W_DATA | "< td >" | C.DISCONNECT_CAUSE | "< table >";
    END LOOP;
    w_data: = w_data | ' < /tr >
    < /table >
    < / html > ';
    UTL_SMTP. DATA
    (v_mail_conn,
    ' Date: '
    || To_char (SYSDATE, ' Dy, hh24:mi:ss DD month YYYY ")
    || CRLF
    || "To:
    || v_from
    || CRLF
    || "Subject:"
    || v_subject
    || CRLF
    || « À : »
    || v_recipient
    || CRLF
    || "MIME-Version: 1.0 '"
    || CRLF
    || ' Content-Type: text/html; "charset ="us-ascii"
    || CRLF
    || w_data
    || CRLF
    );
    UTL_SMTP. Quit (v_mail_conn);
    EXCEPTION
    WHEN UTL_SMTP.transient_error OR UTL_SMTP.permanent_error
    THEN
    raise_application_error (-20000, "cannot send an email: ' |") SQLERRM);
    END;
    /

    Suggest that rather try next approach instead - the start_data() and close_data() calls.

    SQL> declare
      2          type TStrings is table of varchar2(1000);
      3
      4          smtpSender      varchar2(100)   := '[email protected];
      5          smtpRecipient   varchar2(100)   := '[email protected];
      6          mailSubject     varchar2(100)   := 'Sample Mail';
      7          smtpConn         UTL_SMTP.connection;
      8
      9          cursor cur is
     10                  select
     11                          ''||object_type||''||
     12                          object_id||''||object_name||
     13                          ''
     14                  from    user_objects
     15                  order by
     16                          object_id;
     17
     18          mailBody        TStrings;
     19
     20  BEGIN
     21          smtpConn := UTL_SMTP.open_connection( 'mail.telkom.co.za', 25);
     22
     23          UTL_SMTP.helo( smtpConn, 'myserver.somedomain.com' ); -- // this needs to be your Oracle server hostname or IP!
     24          UTL_SMTP.mail( smtpConn, smtpSender );
     25          UTL_SMTP.rcpt( smtpConn, smtpRecipient );
     26
     27          -- can be done using an implicit cursor instead
     28          open cur;
     29          fetch cur bulk collect into mailBody;
     30          close cur;
     31
     32          -- start sending mail body using the data command
     33          UTL_SMTP.open_data( smtpConn );
     34
     35          -- write header
     36          UTL_SMTP.write_data( smtpConn, 'MIME-Version: 1.0'||utl_tcp.CRLF );
     37          UTL_SMTP.write_data( smtpConn, 'Content-Type: text/html'||utl_tcp.CRLF );
     38          UTL_SMTP.write_data( smtpConn, 'From: '||smtpSender||utl_tcp.CRLF );
     39          UTL_SMTP.write_data( smtpConn, 'To: '||smtpRecipient||utl_tcp.CRLF );
     40          UTL_SMTP.write_data( smtpConn, 'Subject: '||mailSubject||utl_tcp.CRLF );
     41
     42          -- empty line between header and rest of mail body
     43          UTL_SMTP.write_data( smtpConn, utl_tcp.CRLF );
     44
     45          -- now write the HTML
     46          UTL_SMTP.write_data( smtpConn, ''||utl_tcp.CRLF );
     47          for i in 1..mailBody.Count
     48          loop
     49                  UTL_SMTP.write_data( smtpConn, mailBody(i)||utl_tcp.CRLF );
     50          end loop;
     51          UTL_SMTP.write_data( smtpConn, '
    '||utl_tcp.CRLF ); 52 53 -- close the data command 54 UTL_SMTP.close_data( smtpConn ); 55 56 UTL_SMTP.quit( smtpConn ); 57 end; 58 / PL/SQL procedure successfully completed. SQL>

Maybe you are looking for