Cordova 3.2 + Everlive + Push Notification = No App Title

5 posts, 0 answers
  1. UT
    UT avatar
    3 posts
    Member since:
    Jul 2013

    Posted 24 Jan 2014 Link to this post

    Hi there, first of all, thanks for the great work you've done.
    Now the glitch:
    Compiled the app with Icenium Graphite and Cordova 3.2 using custom pushPlugin 2.1.1.
    While sending push notifications via Everlive API, and Everlive Website, App Title is not displayed, but message is received. 
    Could be related to these:
    https://github.com/phonegap-build/PushPlugin/issues/101
    https://github.com/phonegap-build/PushPlugin/issues/112

    That's ok. But the problem, is their solution.
    They're suggesting to send the title also with the message.
    But I think that is something I can not do with Everlive API.

    What would you suggest?

    EDIT: Also, are there currently any problems with the service, as I can not send Push notifications on 2014-01-24 12:48 GMT?

    Cheers,
    Devrim.

  2. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 27 Jan 2014 Link to this post

    Hi,

    Seems that the new versions of the PushPlugin allow the sender to configure the app title displayed in a push message that targets Android devices.

    So far this option is unavailable through the Telerik Backend Services UI portal, but can be easily achieved using the REST API and the JS SDK. Please, refer to the code samples below.

    We configure a notification object that has two fields:
    -  "Message" that is going to be delivered to platforms different from Android
    -  "Android" field that passes the notification object for Android devices

    Thus we can create and send a notification that is going to be delivered to devices from all platforms and Android devices will have the title in their notifications.

    1. JavaScript SDK example:

    var el = new Everlive('mTE5GTCnWpAhnjR0');

    var notification = {
        "Message": "Push message from my app",
        "Android": { "data": { "title": "Your-App-Title-Here", "message": "Push message from my app" } }
    }

    el.push.notifications.create(notification,
        function (data) {
            alert(JSON.stringify(data));
        },
        function (error) {
            alert(JSON.stringify(error));
        });

    2. REST API example
    Send a POST request to: http://api.everlive.com/v1/your-api-key-here/Push/Notifications with the following data:
    {
      "Message" : "Push Message from my app",
      "Android" : {"data" : { "title" : "Your-App-Title-Here", "message" : "Push message from my app"}}
    }

    Please, let us know if this is helpful for you.

    Regards,
    Anton Dobrev
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UT
    UT avatar
    3 posts
    Member since:
    Jul 2013

    Posted 29 Jan 2014 Link to this post

    That was great info, and it worked perfectly!
    Thanks a lot Anton!

    Cheers,
    Devrim.
  4. divya
    divya avatar
    5 posts
    Member since:
    Jan 2014

    Posted 10 Feb 2014 Link to this post

    hi ,
    I am working on back end services(sample baas push notification) sample appbuilder app. i am getting error
    http://http//api.everlive.com/v1/cfzPZD14yKp2kX6L/Push/Devices/HardwareId/e0908060g38bde8e6740011221af335301010333?_el=1392013968115 404 error under file line is everlive.all.js:192;
    i tried by replacing url with platform.telerik.com, now it is showing "undefined".please help me to resolve

  5. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 10 Feb 2014 Link to this post

    Hello Divya,

    This error is expected to occur and appears in the debug console. Here is the explanation for such behavior:  when enabling the notifications in the sample app it checks if the device (respectively the simulator) is already registered in the backend. If the device is not registered, (e.g. the error code returned by the server is 801) the user is prompted to 'Register' the device. This error appears in the debug console as 404 (Not Found), but it is handled in the client-side code.

    Let us know if this answers your question.

    Regards,
    Anton Dobrev
    Telerik
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
Back to Top