Hi,

This is a cross domain ajax request which is generally not supported 
unless Access-Control-Allow-Origin is set to whitelist your domain. You 
might want to ask for a JSONP api and use angular jsonp api 
<https://docs.angularjs.org/api/ng/service/$http#jsonp>.

On Monday, 26 October 2015 06:30:13 UTC+5:30, Zain Qayyum wrote:
>
> Hey guys,
>
> So I've never used Angular and I have a question. I'm trying to try out 
> this GoNative.io push notifications API for iOS and android, but i can't 
> find any documentation on it.
>
> Basically, they have provided me with the following code to use with 
> AngularJS in order to send push notifications to users when it is run. 
> Right now I'm just trying to get the code to run when a page loads just for 
> testing, but I have no idea how to do it as I can't get it to work. Here is 
> the code they gave me:
>
> var body = {
> platform : 'android', // or 'android' or 'all'
> message : 'Message1',
> title : 'title1', // android only
> publicKey : 'mdamm', // your app's 5-letter publicKey
> live : 'false',
> apiKey : xxxxxxxxxxxxxxxxxx};var options = {
> url: 'https://push.gonative.io/api/send',
> method: 'POST',
> body: body,
> json : true};
> $http.post('/api/push/send', options).success(function(data) {// 
> success!}).error(function(data) {// error!});
>
> http://pastebin.com/FLqw1EfP
>
> Can someone get this code to run?
>
>
> I appreciate the help guys! This code will be used to build a program that 
> will save 200,000 lives annually, so your help is going towards a good 
> cause :)
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to