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

Pushing Notifications via external REST client

1 Answer 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.
Manuel
Top achievements
Rank 1
Manuel asked on 21 Jan 2015, 03:43 AM
Hi, I was trying to setup an end-to-end Push Notifications example using these guides :

I have created a Backend Service project, added Push Notifications for Android, and on the app side, cloned a project from the "Telerik Baas Push Notification", set it up, deployed to the native Android emulator. At this point I am able to send Push messages from the BackEnd Service's "Push Notifications" > "Push Browser" interface and see what looks like a toast-like message with the raw json Push payload on the app screen (so I presume it is working). However, when I try to follow the examples here to send Push notifications using the same API key but from a REST client (mainly SOAPUI), I get a http 404 error, with a payload of .

For example, to try the equivalent of this :

var notification = {
             "Filter": JSON.stringify({
             'PlatformType': 1
             }),
                "Message": "A generic message"
            };
             
            $.ajax({
                type: "POST",
                url: 'http://api.everlive.com/v1/your-api-key/Push/Notifications',
                contentType: "application/json",
                data: JSON.stringify(notification),
                success: function (data) {
                    alert(JSON.stringify(data));
                },
                error: function (error) {
                    alert(JSON.stringify(error));
                }
            });


  *** NOTE that it is this same API key that I am using in the REST URL I am posting to
 * I have put the Google API Project number (12 digit number) in the same main.js where it said "GOOGLE_PROJECT_NUMBER" ( in the car androidProjectNumber)

Other symptoms :
 * After deploying and running the app for the 1st time, when I hit register, it showed an error on the app's screen saying that registration had failed. However, within a few seconds the app turned up on BackEnd services website under "Devices"
 * To enable Push Notifications on the Native Android emulator, I have created an AVD for the Google APIs version 15, and before running the hybrid app, registered a Google account (the same one with the API project) and verified auto-login from the browser.

Why is it working from the website, but not from the REST client ? What am I missing ? 

Thanks a lot for your help !

1 Answer, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 22 Jan 2015, 09:04 AM
Hi,

The issue was resolved in a private support ticket.

Just for reference I am attaching a SoapUI XML request definition. Prior to using it replace the "YOUR_API_KEY" segment of the URL with the actual API key.

Regards,
Anton Dobrev
Telerik
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
Tags
Push Notifications
Asked by
Manuel
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Share this question
or