This is a migrated thread and some comments may be shown as answers.

Cordova 3.2 + Everlive + Push Notification = No App Title

4 Answers 225 Views
Push Notifications
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
UT
Top achievements
Rank 1
UT asked on 24 Jan 2014, 12:21 PM
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.

4 Answers, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 27 Jan 2014, 04:53 PM
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.

0
UT
Top achievements
Rank 1
answered on 29 Jan 2014, 05:20 PM
That was great info, and it worked perfectly!
Thanks a lot Anton!

Cheers,
Devrim.
0
divya
Top achievements
Rank 1
answered on 10 Feb 2014, 06:28 AM
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

0
Anton Dobrev
Telerik team
answered on 10 Feb 2014, 02:15 PM
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)
Tags
Push Notifications
Asked by
UT
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
UT
Top achievements
Rank 1
divya
Top achievements
Rank 1
Share this question
or