Closed sulthankareem closed 8 years ago
Check my comments to these closed issues:
https://github.com/arleyandrada/PushClient/issues/83#issuecomment-101875859 https://github.com/arleyandrada/PushClient/issues/30#issuecomment-99749942
Regards,
Arley
Thanks
I understand the issue. Sorry for diturbing u
Hi, I have purchased the module yesterday. I have created a sample android application, by just copy paste the app.js file u have given in github to my app.js file.Also i put the GCM sender ID. While i run the application it shows, the alert as "unable to register this device, SERVICE_NOT _AVAILABLE". Can u please explain , what is the issue with my app below , I added my app.js content
/**
//Workaround to Titanium Mobile issue #17030 //https://jira.appcelerator.org/browse/TIMOB-17030
var PushClient = require('br.com.arlsoft.pushclient');
var registerOptions = { GCMSenderId : 'XXXXXXXXXXXX', APNTypes : [ PushClient.NOTIFICATION_TYPE_BADGE, PushClient.NOTIFICATION_TYPE_ALERT, PushClient.NOTIFICATION_TYPE_SOUND ] };
var eventSuccess = function(event) { Ti.API.info('eventSuccess:' + JSON.stringify(event));
};
var eventError = function(event) { Ti.API.info('eventError:' + JSON.stringify(event));
};
var eventCallback = function(event) { Ti.API.info('eventCallback:' + JSON.stringify(event));
};
PushClient.addEventListener(PushClient.EVENT_SUCCESS, eventSuccess); PushClient.addEventListener(PushClient.EVENT_ERROR, eventError); PushClient.addEventListener(PushClient.EVENT_CALLBACK, eventCallback);
PushClient.registerPush(registerOptions); var homeWindow = Ti.UI.createWindow({ url : 'ui/handheld/android/HomePage.js', exitOnClose : true, orientationModes : [Ti.UI.PORTRAIT], }); homeWindow.open(); homeWindow = null;
// PushClient.unregisterPush(); // Call this method to unregister