Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Push Error Code 101

$
0
0
                        var privateKey = 'KEY';
			var user_ids = ['116531754956747411721'];
			var appId = 'AppId';

			// Encode your key
			var auth = btoa(privateKey + ':');

			// Build the request object
			var req = {
			  method: 'POST',
			  url: 'https://push.ionic.io/api/v1/push',
			  headers: {
				'Content-Type': 'application/json',
				'X-Ionic-Application-Id': appId,
				'Authorization': 'basic ' + auth
			  },
			  data: {
				"user_ids": user_ids,
				"notification": {
				  "alert":"Hello World!"
				}
			  }
			};

			$http(req).success(function(resp){
			  console.log("Ionic Push: Push success!");
			  console.log(JSON.stringify(resp));
			}).error(function(error){
			  // Handle error 
			  console.log(JSON.stringify(error));
			  console.log("Ionic Push: Push error...");
			});

Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>