Need example of application on push notifications

Hello

Can someone give me some example code snippert to create notifications of type push on both Client and server...

BES push is included as a sample in eclipse + plugin

to BIS-push, I wrote a simplified example that you can find in the KB or the forums to push

http://supportforums.BlackBerry.com/T5/BlackBerry-push-development/sample-code-for-client-software-s...

the article is here:

http://supportforums.BlackBerry.com/T5/BlackBerry-push-development/simplified-bis-push-client-sample...

Tags: BlackBerry Developers

Similar Questions

  • Get a Push notification on app without head and application

    Hello

    I have included an app without a head for my current application, because I am handling becomes class PushService when push comes this application without a head. But I pushservice in running my application also to get called when comes to push, and my request for traffic not called when the push... How can I get push notifications in both without head and noraml app.

    You can take a look at the documentation
    https://developer.BlackBerry.com/native/documentation/Cascades/device_platform/headless_apps/

  • Can we use push notiofications into html5 applications? If yes how? My web application must receive push notifications

    Can we use push notiofications into html5 applications? If yes how? My web application must receive push notifications

    Hope this will help you http://pusher.com/tutorials/html5_realtime_push_notifications

  • 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 client

    Hello

    I need to implement pushing a notice in my application. My application is a mobile service provider. Thus, they will send push notifications when there is a new notification be sent. Now, I want to implement in my code, how these notifications can be captured or received. Are there examples of code for this? or how to do this? can anyone help?

    Thank you

    Here is the example:
    https://github.com/BlackBerry/Cascades-samples/tree/master/pushCollector
    the article about this here:
    https://developer.BlackBerry.com/Cascades/documentation/device_comm/push/developing_a_push_enabled_a...

  • How to deploy Push Notification plugin for PGB CLI 6.3.0 Server and Client?

    Hello friends, I want to deploy the plug-in can push notification app, compiled by PGB CLI 6.0. But suggest to many doubts after reading the documentation... example: how to get the ID register which is located on the client side in mobilies? or you do not need this ID? If anyone has a site with step a step to set up the server and the application, please post the link here... I'm full of doubts... Thank you very much.

    Here is a detailed tutorial of the push plugin.

    Here's how to set up your credentials when you use PhoneGap Build.

  • 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).

  • Push Notification error.

    I want to use Notifcation to push with the DPS Pro Edition.

    I created all certificates of Apple (developer, developer Push, Distribution, Distribution push).

    Push notification has been activated to create the app ID

    I want to add certificates: https://notification.digitalpublishing.adobe.com/notification/index.html#/cert

    But the following error message is displayed.

    What I am doing wrong?

    Thanks for your help.

    Bildschirmfoto 2015-02-22 um 15.35.02.png

    Hi Michael,

    Once you change anything (for example Apple Push Notification service ID App specific), you will need to recreate/updated updated mobileprovision profiles for this application. Also, make sure that you use right APNs as those certificates and mobileprovision profiles are specific App ID.

  • 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

  • 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);

  • Problem of application using Push battery drain

    Hello

    I use push via BIS connection and have an another entry point to manage events to push (the same sample application Blackberry Ant provides). But I need to display popup dialog box whenever I get a push notification, this is why I use the dispatcher lock and event with the other entry point.

    But by using the dispatcher of events with the other entry point my other app continues to run even if it does not receive push messages (I checked the background apps and it showed my replacement), which is causing the battery to drain. Does anyone have an alternative solution or better suggestion for this problem.

    Kind regards

    gmuhammad.

    Found the solution:

    http://supportforums.BlackBerry.com/T5/Java-development/alert-a-BlackBerry-Smartphone-user-from-a-BA...

    You must use the Application instead of the UIApplication class if you want to display popup windows, dialog or background boxes.

    Thanks to: peter_strange

  • I am not able to register for a push notification

    Hello

    My request for id and my password I receive service push RIM has expired. Then I made new registration to push eval for two weeks and I don't have the new ID and I idn can't get response from RIM to extend the expiry date.

    Anyone know if there is problem with push notification?

    Thank you

    Rather than to submit a new application for the same application (it will get rejected as a duplicate), please send an email to [email protected] with the request. Be sure to include all information for your application that needs to EVAL period.

  • 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

  • BB10 - customization BB Hub and Push Notification Messages

    Hi all.

    The push notification are push to the notification in the hub of BlackBerry. Is it possible for example to create a new label to a custom in the hub application and have the notification being pushed in the custom label?

    No, it is not possible for third-party applications.  Only some apps approved (such as FaceBook, Twitter and LinkedIn) have had access to their own 'space' in the hub.

  • Sencha Touch 2 w / Push Notifications

    Hey all,.

    I'm new to the world of BlackBerry development and confused about some things. I am developing an application using Sencha Touch 2, but I need to have the Push Notifications. I understand that this is something that can be done through the API WebWorks, but I was under the impression that you could use the framework WebWorks or Sencha Touch 2 framework; they are mutually exclusive.

    I recently read a post on the forum, which would seem to contradict that, someone had integrated the functions of the WebWorks API in their project of Sencha Touch 2. Could someone give me an idea of exactly how do you it?

    Thank you!

    Welcome!

    Resemble WebWorks an extra set of API, you can use to create applications that require access to hardware or services of BlackBerry.

    If you build your application in Sencha Touch and whenever you need to have access to something specific to the device, simply make you calls to your App, exactly as you would call a Sencha Touch method.

    It is similar to how you would add external application of Sencha Touch libraries, because the SDK does not provide a component you need.

Maybe you are looking for