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

Attempt to access Urban Airship while NOT flying

$
0
0

I'm getting this response everytime that I try to enable push notifications on android.

I have the urban airship module ver 2.3.2,

I have the airshipconfig.properties in the correct path (app>platform>android>bin>assets)

developmentAppKey = XXX
developmentAppSecret = XXX
 
productionAppKey = XXX
productionAppSecret = XXX
 
#transport is "gcm", "helium" or "hybrid".
#note: the helium and hybrid transports are premium features.
#for complete pricing information, see http://urbanairship.com/pricing/
 
transport = gcm
 
gcmSender = XXXX
inProduction = false
 
iapEnabled = false
Trying the Code example that comes with de module
var UrbanAirship = require('ti.urbanairship');
Ti.API.info("module is => " + UrbanAirship);
 
// Set UA options
UrbanAirship.showOnAppClick = true;
UrbanAirship.tags = [ 'testingtesting', 'appcelerator', 'my-tags' ];
UrbanAirship.alias = 'testDevice';
 
// Display current pushId (use ua.c2dmId if using C2DM)
labelAPID.text = UrbanAirship.pushId;
 
// Set switch to current state of push
pushOnSwitch.value = UrbanAirship.pushEnabled;
 
// Toggle push state on switch change
pushOnSwitch.addEventListener('change', function (e) {
    UrbanAirship.pushEnabled = e.value;
});
 
function eventCallback(e) {
    if (e.clicked) {
        Ti.API.info('User clicked a notification');
    } else {
        Ti.API.info('Push message received');
    }
    Ti.API.info('  Message: ' + e.message);
    Ti.API.info('  Payload: ' + e.payload);
 
    labelMessage.text = e.message;
    labelPayload.text = e.payload;
}
 
function eventSuccess(e) {
    Ti.API.info('Received device token: ' + e.deviceToken);
    labelAPID.text = e.deviceToken;
}
 
function eventError(e) {
    Ti.API.info('Error:' + e.error);
    var alert = Ti.UI.createAlertDialog({
        title:'Error',
        message:e.error
    });
    alert.show();
}
 
UrbanAirship.addEventListener(UrbanAirship.EVENT_URBAN_AIRSHIP_CALLBACK, eventCallback);
UrbanAirship.addEventListener(UrbanAirship.EVENT_URBAN_AIRSHIP_SUCCESS, eventSuccess);
UrbanAirship.addEventListener(UrbanAirship.EVENT_URBAN_AIRSHIP_ERROR, eventError);
In the console log I just keep getting: Attempt to access Urban Airship while NOT flying

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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