Exception in Push Notification BIS

Hello

I'm new to the development of BlackBerry applications. I wrote a Java for Push Notification using PushSDKProperties class.

My class is given below.

public

class {PushServer}

private public static String password = "password";

private public static String targetURL = "targetURL;

private public static final String APP_ID = "app_id";

private public static PushSDKProperties getProperties() {}

PushSDKProperties = PushSDKProperties

new PushSDKPropertiesImpl();

() pushSDKProperties.setPpgAddress

targetURL);

() pushSDKProperties.setUsingPublicPush

( true) ;

() pushSDKProperties.setHttpIsPersistent

( fake) ;

pushSDKProperties.setHttpConnectionTimeout (60000);

pushSDKProperties.setHttpReadTimeout (120000);

() pushSDKProperties.setUsingXmlParserDtdValidation

( fake) ;

System.

out.println (pushSDKProperties);

Return pushSDKProperties;

}

public public static Date of futureDate (int day) {}

long futureDateMS = System.currentTimeMillis () + ((long) days) * 24 * 60 * 60 * 1000;

Date futureDate =

new Date();

futureDate.setTime (futureDateMS);

Return futureDate;

}

public public static void main (String [] args) {}

try {

IdGenerator idGenerator =

new IdGeneratorImpl();

= Address list

new ArrayList();

DeliverBeforeTimestamp date = futureDate (90);

Addresses.Add ("push_all");

() Addresses.Add

"correct_address");

() Addresses.Add

"Incorrect_address");

PushMessageControl = PushMessageControl

new PushMessageControl (APP_ID idGenerator, addresses);

pushMessageControl.setDeliverBeforeTimestamp (deliverBeforeTimestamp);

Content content =.

new TextContent ("Hello World");

PapService = PapService

new PapServiceImpl();

PushSDKProperties pushSDKProperties = getProperties();

Customer HttpClientImpl =

new HttpClientImpl();

client.setPushSDKProperties (pushSDKProperties);

papService.setHttpClient (customer);

papService.setPushSDKProperties (pushSDKProperties);

System.

out.println ("1". (+ papService);

System.

out.println ("2". (+ pushMessageControl);

System.

out.println ("3." Until this exception no.");

System.

out.println ("4." + pushSDKProperties.getPpgAddress ());

String pushId1 = pushMessageControl.getPushId ();

PushResponse response = papService.push)

APP_ID, password, APP_ID, pushMessageControl, content);

System.

out.println (Response.GetDescription ());

System.

out.println (Response.GetResult ());

System.

out.println (Response.getPushId ());

System.

out.println (Response.GetCode ());

}

catch (UnauthorizedException at an e) {

e.getCause ();

}

catch (E PushSDKException) {

e.getCause ();

}

catch (E BadMessageException) {

e.getCause ();

}

catch (Exception e) {

e.printStackTrace ();

e.getCause ();

}

}

}

My code works fine for a single address (correct address / valid device) and my device is to pass the Notification Message.

My problem is with the sending of the Notification to multiple devices. If I give more than one address and one of the addresses is wrong / bad / address belongs to the unit is turned off, then his throw me the BadMessageException - response Code 2000 invalid / missing attribute...

My Question is how can I make my code works regardless of the address correct or incorrect, I want to say how can I get the code of individual response for each address / device.
I want success message to the correct and invalid address error code / message for the invalid / incorrect address.

What should I do? Any code changes or anything?

Help, please.

Thanks in advance...

Even if it is an arbitrary pine which is 8 digits then you should not return BadMessageException.

The General to push hypothesis, is that you're doing a fire-and-forget.  Send you the thrust of all of the addresses and it will be reliable send it to a BlackBerry smart phone (if this device has your running application has registered to receive impulses) without requiring you need to check on the status of the final delivery.

On your side, you must maintain a list of the pins that are registered to receive the growth of your application so that you know what devices you can send push to.

Matt

Tags: BlackBerry Developers

Similar Questions

  • Push notification without BIS...

    Dear friends...
    Can I receive a push notification on file .apk (Android application) running on the 10 Blackberry without BIS?

    Best regards.

    Thank you...

    BlackBerry 10 does not use BIS.

  • Android.cfg file not created - BB10 Push Notification

    I'm enbaling push notification in my android app BB10 runtime. I'm following this doc to implement the push. I developed the Android using Novell project. I tried different ways to create the file cfg under bar.

    1. Before you create the apk, added the cfg file in the root of the project name of the application (tried naming as android.cfg also).
    2. Using this apk, I generated the .bar file, but Android folder, res folder and apk file do not exist, cfg file is not exist.
    3. Then I tried to add file cfg under bar file after you have created the apk but before signing bar leader, but I started getting the following error:
    Error: No manifest.
    Exception in thread "main" java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at net.rim.tools.signing.SigningMain.main(SigningMain.java:72)
    Caused by: java.lang.Exception: java.lang.RuntimeException: No manifest.
            at net.rim.device.codesigning.barsigner.BarSigner.if(Unknown Source)
            at net.rim.device.codesigning.barsigner.BarSigner.main(Unknown Source)
            ... 5 more
    Caused by: java.lang.RuntimeException: No manifest.
            at net.rim.device.codesigning.barsigner.BarSigner.try(Unknown Source)
            ... 7 more
    

    I see a lot of post where push is activated with success in app Android Runtime BB10. What I'm doing wrong here?

    Hey Subha_Murali,

    Follow the instructions on this page or complie the sample application. It always works for me flawlessly!

  • How to make the push notification as APN (notification of transmission of apple) with Blackberry API

    Hi all

    I want to know how to get push notification as we APN. I found a demo in the code example of RIM named "httppushdemo" with the server and client code.

    It works this way,

    My custom server (java servlet) push a few data for some static ip (on MDS with given port), on my desk and the BB device receive the MDS data, where my blackberry MDS Simulator is on. So in this case I got direct push notification when the application is activated.

    Flow for Simulator is so as:

    Server customized---> MDS (with specific ipadrees / port)<-------------- >

    (do)                                                              (receive the push)

    But my question is that, in the event of a real device, I have MDS to push the text to the specific ip address.  I have MDS in my device itself. So from where custom server I need to push the text?

    Direct to device? if yes then please tell me where I can change my bb device ip address. ?

    Thanks in advance,

    Tejas

    The AFN is similar to the notion of PPG in BlackBarry who is world BES MDS or Service of Push BlackBerry World BIS. Http you post your button to one of the PPG and it routes the message to the device for you.

    Keep in mind when you push user push BIS and BES that push you to the device with address e-mail or a PIN that you can push only per SPINDLE.

  • Push notification by using the credentials of the Production

    Using credentials given by BB Push notification team, I send you notification on the device. But get send status SUCCESS and does not notice on BB device (client).

    It worked very well with credential assessment earlier. I am currently train with Production credentials

    Please, help me in this.

    Note: BIS is on my device.

    Thank you

    I had the question. It was matter of time zone. I am in India & is my servier in the United States...

    Now I get the notification.

    Thanks for responding.

  • BB10 Push notification: PushPayLoad

    I'm developing a c# application that can send a push notification to BB10 devices using Blackberry Internet Service, I found a code it works well, however I don't know how to add custom to the push, data data that can be access with the push as pushPayLoad and used that is when user click on the push notification , it will run my native application bb10 then navigate to the user window or any other open window as required bussiness

    Here are my c# code:

    HttpWebResponse HttpWRes = null;
                HttpWebRequest HttpWReq = null;
    
                string pin = "push_all";
                string applicationID = "ApplicationID";
                string BOUNDARY = "ASDFaslkdfjasfaSfdasfhpoiurwqrwm";
                string msg = "Good morning"; // the message to send
    
                string userName = "ApplicationID";//"YOUR_APPLICATION_ID";
                string userPW = "YourPassword";//"YOUR_PASSWORD";
    
                string url = "https://pushapi.eval.blackberry.com/mss/PD_pushRequest";
    
                HttpWReq = (HttpWebRequest)WebRequest.Create(url);
    
                //SetProxy(HttpWReq); //if proxy needed, use this
    
                HttpWReq.Method = ("POST");
                HttpWReq.Accept = "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
                HttpWReq.KeepAlive = true;
                //HttpWReq.Credentials = new NetworkCredential(userName, userPW);
    
                HttpWReq.PreAuthenticate = true;
                HttpWReq.ContentType = "multipart/related; boundary=" + BOUNDARY + "; type=application/xml";
    
                SetBasicAuthHeader(HttpWReq, userName, userPW);
                StringBuilder dataToSend = new StringBuilder();
    
                dataToSend.AppendLine("--" + BOUNDARY);
                dataToSend.AppendLine("Content-Type: application/xml; charset=UTF-8");
    
                dataToSend.AppendLine("");
                dataToSend.AppendLine("http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd\">");
                dataToSend.AppendLine("");
                string myPushId = DateTime.Now.ToFileTime().ToString();
                string deliverBefore = DateTime.UtcNow.AddMinutes(5).ToString("s", System.Globalization.CultureInfo.InvariantCulture) + "Z";
                dataToSend.AppendLine("");
    
                dataToSend.AppendLine("
    "); dataToSend.AppendLine(""); dataToSend.AppendLine(""); dataToSend.AppendLine(""); dataToSend.AppendLine("--" + BOUNDARY); dataToSend.AppendLine("Content-Type: text/plain"); dataToSend.AppendLine("Push-Message-ID: " + myPushId); dataToSend.AppendLine(""); dataToSend.AppendLine(msg); dataToSend.AppendLine("--" + BOUNDARY + "--"); dataToSend.AppendLine(""); Stream requestStream = null; string pushResult = ""; try { requestStream = HttpWReq.GetRequestStream(); } catch (Exception ex) { pushResult = "Push failed! " + ex.ToString(); } byte[] outStr = new UTF8Encoding().GetBytes(dataToSend.ToString()); requestStream.Write(outStr, 0, outStr.Length); requestStream.Close(); try { HttpWRes = (HttpWebResponse)HttpWReq.GetResponse(); } catch (Exception ex) { //push failed } if (HttpWRes != null) { HttpWRes.Close(); }

    What are the changes that I must code to send data as well as the thrust as profileId = 123?

    After much trial and error, I finally found the answer: adding "msg" I can add all payload elements I want:

    MyStringBuilder.AppendLine ("profileId"+":" + "AAB123");

    MyStringBuilder.AppendLine ("postId"+":" + "4567");

    MyStringBuilder.AppendLine (msg);

  • Not able to receive a Push Notification with App ID: 4531-* a76s4

    Hello

    I'm new to the Blackberry development,

    I signed up with the service to Push Black berry assessment

    and received the AppID as: 4531-* a76s4,.

    I used this App ID to test Push notifications for my sample Application,

    can I use the same ID App for multiple Applications to receive Push Notifications,

    because I can't register a new ID app for my other applications,

    Please suggest on this.

    Credentials EVAL, you can use the same credentials to push without much concern.

    However in general for PROD you wish to push single credential by application to avoid accidentally sending a big boost for an application to several applications. And since you want to PROD unique credentials for each application (except if you share them grows) then you can go as well with unique EVAL references as well.

    Why are you unable to save of new credentials to push for your second app?

  • To some specific devices push notification is sent

    Hi, guys!

    I implement notifications of type push client-side using net.rim.blackberry.api.push. As far as I understand, there is no way to pass data to the device, or to a particular user at registration (I mean registerApplication() in PushApplicationRegistry) so my push initiator will not be able to send notifications only to some specific devices, not at all registered with the application id given. Is this fair?

    On the other hand, I know that using the server-side net.rim.pushsdk library, I can indicate some addresses to which notification will be sent. They are stored in the PushMessageControl instance that is passed to the net.rim.pushsdk.pap.PapServiceImpl.push () method. Could you please explain me what are these addresses and how do I send their customer when registering for notifications?

    Or maybe I am totally lost in all of this...

    Thanks in advance

    Hi Valera,

    Here is a simple code to push to BIS.

    List = new ArrayList ()addresses;

    Addresses.Add ("27f45fc5");

    PushMessageControl pushMessageControl = new PushMessageControl (idGenerator, APP_ID, addresses);
    Content content = new TextContent (data);
    PapService papService = new net.rim.pushsdk.pap.PapServiceImpl ();
    Properties PushSDKProperties = getProperties();
    HttpClientImpl client = new HttpClientImpl();
    client.setPushSDKProperties (properties);
    papService.setHttpClient (customer);

    papService.setPushSDKProperties (properties);
    PushResponse response = papService.push (APP_ID, password, APP_ID, pushMessageControl, content);

    Just add the pins you want to send to in the address list.

    HTH

    Chris

  • 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

  • with regard to the push notification

    Hello
    I implement push notification in my application and I register for push and received credientials of push notification. I just want to know which register credientials with my code so I need bis...?

    Consumer Push requires BIS - B.

    If the phone you are trying to push to SAY b, then you won't be able to push him.

  • Renewal of certificates/Push Notifications

    Can someone please help me understand the process of renewal of my Apple certs & push notification files? More precisely:

    1 Apple warn me when a cert needs to be renewed? Can I do that before it becomes due?

    2. what happens if a cert expires? My application doesn't work anymore?

    3 do I need reconstruction/new submission to Apple my app via the App Builder for updating my CERT or is it possible to update just the CERT Apple Portal?

    Any help would be appreciated. Thank you.

    1. No, Apple didn't send notification. If your hundred p12 dev and dist expire, your application will be rejected at some point in the submission process - I don't remember when. It might be by building the app. If you don't update your application, do not import expired certs dev and dist. Users can always use your application as before. You can even submit an application with expired certificates push and your application will work well - with the exception of push, of course.

    2. the application of the distribution in the store and on devices of users will still work if the distribution p12 has expired, but you will need to update the cert before introduce you a new version of the app. It is my understanding. A production push expired cert affects only push them himself. If your push cert is expired, you will get an error message when you click on warn. Users can still subscribe, download and see the articles independently of push, but they don't get badges or background downloads.

    3. If your dev and dist p12 CERT is expired, just update before submitting a new version. You don't need to rush to do it. For the cert to push p12, I don't think that you must resubmit the application. I think that if you revoke it and rebuild the CERT to push, the change is saved with Apple, and you can click Notify without error. I'll test it soon.

  • Apple Push Notification Service production

    I have two applications (just built) that send notifications to and from a web server remotely: everything works fine until yesterday, expiration date of Apple's Push Notifications. I create new certificates (from original CSR files), create a .pem file and download it into my production server, replace the older ones, but when I tested the downloaded Apps from the App Store has not received notifications (in the mode of development that all notifications have arrived properly).

    can someone help me please?

    .. the certificate on my developer account is active (a green dot on the side of Pentecost) and not expired!

    Help

  • Moto G4 - push notifications to stop functioning when the phone is idle / inactive

    Hello!

    I have a very annoying problem with my G4 bike purchased in the UK.

    Problem:

    My push notification comes to app and gmail to stop working when the phone is idle / inactive.

    When I use any application or when I put just the phone side push notifications work fine. They appear on the lock screen and beep.

    After a few minutes of not using the phone, the message to stop the spread. The sender indicates that a tick and the Moto G4 does not show notifications of type push until the phone is activated and unlocked. It is very annoying, because I already missed several attempts to call. This problem occurs with the Wifi or data plan. It is not a What'sApp of settings as it works very well for a while.

    Text messages and phone calls work well, just a data plan seems to go off when idling and never come back until unlocked (even then it takes a while). WiFi seems somehow to maintain a connection.

    I tried:

    • change What settings the sApp
    • disconnection/connection gmail account
    • remove the operating system of the device cache
    • disable the whats of ap battery saving options and all services appear to be relevant
    • WiFi seems somehow to keep the phone, but only data stops immediately, sending fn when idle
    • Restart in safe mode-> the same problem with meeting places. WiFi seems to work, data plan do not when idling

    Is this a known issue? Everyone knows the problem? To me, it seems that the camera seems to move from the internet and do not reactivate until this that unlocked.

    Any suggestion would be appreciated,

    Thank you!

    It seems to work now after clicking: 'Reset the settings App' in the top menu right in "parameters - apps-> gear-> battery optimization"!

    I haven't seen this solution anywhere else. I did the reset done only because I tried to disable optimization for almost all applications gradually. Without success, I clicked on 'Reset the settings App' and suddenly push notification for all work! Yes!

  • Push notifications don't work properly

    Hello! Ive had a problem with my notifications push on incoming messages in Whats App, Hangouts, messaging applications.
    I get no notification either when z3 is in "sleep" or active. Moreover, I only receive new messages when I open a respective application. Even if I have it running but not active at the moment, I don't get notifications unless I have switxh to the app and check a cat or an Inbox manually. Please help solve the problem.

    In this case, there could be a problem with your APN settings. See the following:

    https://talk.sonymobile.com/T5/Xperia-Z1-Z1s/Sony-Xperia-Z1-push-notifications-problems/m-p/522571#M...

  • Acceleration of approval of push notification service

    I wonder if there's a place I can reach out to the acceleration to the top of my push notification service application. Five days seems a bit long to test the existing integration with my Android build.

    Anyone has any advice to help get things moving?

    I checked with the team to push and all pending requests have been processed.  Then you should be all set.  If you have not received notification, check your spam filter in case the message was taken there.

Maybe you are looking for

  • iTunes won't install correctly

    Hello I am using windows 7 32 bit. Updating to iTunes, I encountered a problem that many seem to have. I've deleted and reinstalled iTunes 10 times with the instructions in the following link: https://support.apple.com/en-ca/HT204275 I usually find m

  • Good work of the fn in Satellite L30.

    Sorry for the inconvenience. I have the Satellite L30. A month ago the fn began to malfunction. ("Upside down").Codes 'Fn' (the blue keyboard color) of all key works when you press the Fn key does not work. But the correct values of the key works onl

  • W500 forgets that it is connected wireless

    I have a W500, which is connected via a wireless hub and very frequently does not recognize that it is connected to the web. All other computers are connected, but this one seems to forget, and I have to disconnect and reconnect. Anyone has an idea w

  • @ Eric HP technical support

    Our computer is completely dead a few weeks before, I was afraid really to call technical support, because that kind of thing is usually so frustrating, but I was helped by a guy named Eric, who was very helpful and patient, he does have a computer t

  • How to cure the error of volume?

    Windows 7 Professional (X 64) is installed on my laptop. When I start the laptop, sound is coming for 5 minutes until it opened correctly. I can't solve this problem because I lost my DVD of windows. any body will support me on this issue?