Page 4 of 4

pushNotificationDeviceID not unique on iOS devices

Posted: Thu Apr 10, 2014 7:27 pm
by Case

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


pushNotificationDeviceID not unique on iOS devices

Posted: Fri Apr 11, 2014 7:37 am
by Maryna Brodina

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.


pushNotificationDeviceID not unique on iOS devices

Posted: Fri May 30, 2014 9:00 pm
by Evolucion Ip

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


pushNotificationDeviceID not unique on iOS devices

Posted: Fri May 30, 2014 9:50 pm
by SteveLacy

I switched to the 1.2 library which resolved the issue.


pushNotificationDeviceID not unique on iOS devices

Posted: Sat May 31, 2014 9:37 am
by Evolucion Ip

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.


pushNotificationDeviceID not unique on iOS devices

Posted: Sat May 31, 2014 4:38 pm
by SteveLacy

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


pushNotificationDeviceID not unique on iOS devices

Posted: Sun Jun 01, 2014 11:20 pm
by Evolucion Ip

Thanks a lot Steve, It worked like a treat!