Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

Push notification retrive token retries

$
0
0

Am using 3.2.2.GA sdk, Alloys and Android, Have sent push notification from my application and sometime retrieveDeviceToken retrying to fetch device, on the meantime my errorcallback had been called often but device token is achieved. While logging in am fetching token so in errorcallback I kept an alert use proper username and password if an error comes. But here the alert arrives but logs in. Is there any way to track when retry ends while fetching token.

My code

function retrieveDeviceToken(successCallback, errorCallback){
        var successCallback = (successCallback) ? successCallback : function(){};
        var errorCallback = (errorCallback) ? errorCallback : function(){};
        CloudPush.retrieveDeviceToken({
            success: function deviceTokenSuccess(e) {
                //alert('Device Token: ' + e.deviceToken);
                var deviceToken = e.deviceToken;
                successCallback(e);
            },
            error: function deviceTokenError(e) {
                //alert('Failed to register for push! ' + e.error);
                errorCallback(e);
            }
        });
    }
Here errorCallback had been called twice or thrice sometimes. Thanks in advance.

Viewing all articles
Browse latest Browse all 7655


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