Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

pushNotificationDeviceID not unique on iOS devices

Hi Steve -- is your app shared with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a? If yes - please remind it's name.

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

pushNotificationDeviceID not unique on iOS devices

Yeah the app is shared with a href="mailto:support@Appery.io" rel="nofollow"support@Appery.io/a. The app is named ChurchAppLive.

The FB login link (currently invisible) is found on the "Login" page.

The frustrating part is that this FB login function has been working for months until I had to change the library version to 1.2.

Thanks for any help you can provide.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

pushNotificationDeviceID not unique on iOS devices

Hi Steve,

This works for us. What localStorage variable can we check?

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

pushNotificationDeviceID not unique on iOS devices

By the way, I was doing all my testing on the Appery.io Android tester app. The app launches and will take you to a screen (FindChurch) to choose a nearby member church. When you select the church, the local storage variable "churchid" is set. The app will then take you to a screen to login. The login screen has the FB login link (currently invisible). Following the FB link will allow you to login via FB, but upon return the "churchid" variable is no longer set.

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

pushNotificationDeviceID not unique on iOS devices

Hello! The issue is that if you don't have ChildBrowser you just use prewindow.open(url);/pre that means you load Facebook site instead your app then do redirect not to the app, but to the test page prehttp://appery.io/app/view/34228ef6-xxxx-xxxx-xxxx-xxxxxxxxxxx/FacebookLogin.html/preso it's not your app opened after redirect from Facebook, but app preview. To avoid it instead prewindow.open(url);/pre you should open url in InAppBrowser and do the same as with ChildBrowser. For example prevar ref = window.open(url, '_blank', 'location=no');
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('FacebookLogin', {reverse: false}); / Navigate to page 'result' */
}
});/pre

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

pushNotificationDeviceID not unique on iOS devices

Sweet!!! That fixed it!

Thank You! Thank You!!

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

pushNotificationDeviceID not unique on iOS devices

Steve, have you sorted any of these issues. I am having the same problem with the device ID's. And i am using 1.2 library and phonegap 3.0

Also, are you using xcode 5 with javascript ?

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

pushNotificationDeviceID not unique on iOS devices

I no longer experienced the issue once I changed to the 1.2 version library. Yeah I'm using the phonegap 3.0.0.

I'm not sure I understand your question regarding the Xcode 5 with javascript. I'm now using Xcode5 to publish the app to iOS and yes the app definitely has javascript. I had problems with the Xcode export into Xcode 5 in the past, but apparently Appery fixed the issue and it now works with Xcode 5.

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

pushNotificationDeviceID not unique on iOS devices

Okay, I had the same issue with different uuid's for iOS which will cause a problem, so will need to change the app design.

I use Apery and export it as a ipa file, and use iTunes to test it. But i thought you coded your app via xcode.

Seemed odd that there is much going back and forth to test it, which is why I asked about how you use Xcode.

But thank you for getting back to me :)

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

pushNotificationDeviceID not unique on iOS devices

Can you help me out a bit more with where this code should go (what it should replace)? Based on the current tutorial the click event for the 'Connect to Facebook' button is:

code
/* Script to oAuth to Facebook app */
var redirectUrl = 'http://appery.io/app/view/dcxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resultsFacebook.html';

var url = 'https://www.facebook.com/dialog/oauth?client_id=xxxxxxxxxxxxxxxxx';
url += '&redirect_uri=' + redirectUrl;
url += '&scope=basic_info,user_photos,user_status,friends_photos,friends_status';
url += '&state='+OAuth.nonce(17);

var cb = null;
if(window.plugins) {
cb = window.plugins.childBrowser;
}
if (cb != null) {
/* When native childBrowser plugin must be used to navigate to facebook. /
cb.onLocationChange = function (url) {
if(url.indexOf(redirectUrl) === 0) {
/ if user successfully logged in /
cb.close();
var vars = parseUrlVars(url);
localStorage.setItem('code', vars.code); / store secret code /
Appery.navigateTo('result', {reverse: false}); / Navigate to page 'result' */
}
};

Code: Select all

cb.showWebPage(url); 

}
else {
localStorage.setItem('code', '');
window.open(url);
};
/code

I tried to replace from var cb=null through the cb.showWebPage(url); and retain the else statement but no go. I'm about to add an Instagram connection as well but would really like to make sure I'm using the correct InAppBrowser and not redirecting users to the preview page (but to the real app).

Thanks

Return to “Issues”