Case
Posts: 0
Joined: Mon Mar 10, 2014 12:08 am

pushNotificationDeviceID not unique on iOS devices

Hey Steve, any chance you can post your working snippet for others?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

pushNotificationDeviceID not unique on iOS devices

Hello!

Try the following codeprevar redirectUrl = 'http://appery.io/app/view/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx/result.html';

var url = 'https://www.facebook.com/dialog/oauth?client_id=XXXXXXXXXXXX';
url += '&redirect_uri=' + redirectUrl;
url += '&scope=user_education_history,friends_education_history,user_work_history,friends_work_history';
url += '&state='+OAuth.nonce(17);

if (typeof(cordova) !== "undefined") {
var ref = window.open(url, '_blank', 'location=yes');
ref.addEventListener('loadstart', function(event) {
if(event.url.indexOf(redirectUrl) === 0) {
/* if user successfully logged in /
ref.close();
var vars = parseUrlVars(event.url);
localStorage.setItem('code', vars.code); / store secret code /
Appery.navigateTo('result', {reverse: false}); / Navigate to page 'result' */
}
});
} else {
localStorage.setItem('code', '');
window.open(url);
};/preplease note on device this code should be invoked only after device ready event.

Evolucion Ip
Posts: 0
Joined: Sun May 25, 2014 12:53 pm

pushNotificationDeviceID not unique on iOS devices

hi, I'm experiencing the same problem. What is the library you updated to version 1.2?

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

pushNotificationDeviceID not unique on iOS devices

I switched to the 1.2 library which resolved the issue.

Evolucion Ip
Posts: 0
Joined: Sun May 25, 2014 12:53 pm

pushNotificationDeviceID not unique on iOS devices

yes but which library? HOw did you update it? I got lost following the thread and I'm not sure if you were talking about a PhoneGap library configurable inside Appery or about another external library.

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

pushNotificationDeviceID not unique on iOS devices

Go to your app settings tab and choose the "external resources" option. Near the top, you can select the library version.

Evolucion Ip
Posts: 0
Joined: Sun May 25, 2014 12:53 pm

pushNotificationDeviceID not unique on iOS devices

Thanks a lot Steve, It worked like a treat!

Return to “Issues”