Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

INVALID_SENDER error while trying to use GCM

$
0
0

I'm trying to get push notifications working with GCM, but I keep getting an INVALID_SENDER error.

I've gone to https://console.developers.google.com/ , created a project and took note of the Project Number (Sender ID), I enabled Google Cloud Messaging for Android in the APIs, then I created a new Public API Server Key and left the IPs list empty.

Once I've done all that I went into my ACS Management for my project, made sure the Development tab was selected, and in the Android Push Configuration I put the Project Number as the Sender ID and the API Key from the Server key I created, and I saved the settings.

In my tiapp.xml I have the ACS API and oAuth key properties setup correctly, as my app works fine for iOS push notifications.

In my project, I put the following code...

var deviceToken = null;
 
// Require the module
var CloudPush = require('ti.cloudpush');
 
// Initialize the module
CloudPush.retrieveDeviceToken({
    success : deviceTokenSuccess,
    error : deviceTokenError
});
// Enable push notifications for this device
// Save the device token for subsequent API calls
function deviceTokenSuccess(e) {
    deviceToken = e.deviceToken;
    Ti.API.info("Device Token: " + deviceToken);
}
 
function deviceTokenError(e) {
    Ti.API.error('Failed to register for push notifications! ' + e.error);
}
 
// Process incoming push notifications
CloudPush.addEventListener('callback', function(evt) {
    Ti.API.info("Notification received: " + evt.payload);
});
And I get the error: [ERROR] Failed to register for push notifications! INVALID_SENDER

I've searched this issue and have read/followed all the tutorials that have been linked to ( http://developer.android.com/google/gcm/gs.html , http://www.titaniumtutorial.com/2013/10/acs-push-notification-using-gcm.html , and https://medium.com/titanium-templates/sending-push-notifications-through-appcelerator-cloud-api-93068bfab9f6 ) and still get that error.

As far as I can tell, I'm doing everything properly. Am I missing something?


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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