Page 1 of 1

Apperyio.navigateTo doesn't work at the first moment

Posted: Sun Nov 22, 2015 4:07 am
by Paulo Fraga

I have an ionic and angularjs app with two pages. The first one is a login page, and the second one is a loginSucess page. In the login page i put a button that runs the code below on the ng-click:

This function runs a facebook login routine.

// Function code
var ref = new Firebase("https://pet-wise.firebaseio.com/users");
ref.authWithOAuthPopup("facebook", function(error, authData) {
if (error) {
console.log("Login Failed!", error);
} else {
Apperyio.navigateTo("loginSucess", {});
console.log("Authenticated successfully with payload:", authData);

}
});

When I click on the facebook login button for the first time, the app performs the function and returns the authData object sucessfully, but the app remains on the login page. On the console I can see the authData object. The expected behavior would be that the app was directed to the loginSucess page.
Just when I click the button for the second time the app redirects to the loginSucess page.

What am I doing wrong?


Apperyio.navigateTo doesn't work at the first moment

Posted: Sun Nov 22, 2015 10:08 am
by Serhii Kulibaba

Hello Paulo,

Please add a timeout before navigation to other page:

setTimeout(function(){
Apperyio.navigateTo("loginSucess", {});
}, 100);


Apperyio.navigateTo doesn't work at the first moment

Posted: Sun Nov 22, 2015 12:47 pm
by Paulo Fraga

Sergiy, unfortunately it doesn't work.

Please see the images of the app runing in test mode, and the console response.

First screen when the test starts...
Image

Screen and console after the first click...
Image

Screen and console after the second click...
Image

The code of the button is below:

// Function code
var ref = new Firebase("https://pet-wise.firebaseio.com/users");
ref.authWithOAuthPopup("facebook", function(error, authData) {
if (error) {
console.log("Login Failed!", error);
} else {
console.log("Authenticated successfully with payload:", authData);
setTimeout(function(){
Apperyio.navigateTo("loginSucess", {});
var sucess = true;
console.log('Login:'+sucess);
}, 100);
}
});


Apperyio.navigateTo doesn't work at the first moment

Posted: Mon Nov 23, 2015 10:06 pm
by Paulo Fraga

Please, does anybody can help me?


Apperyio.navigateTo doesn't work at the first moment

Posted: Thu Nov 26, 2015 2:21 pm
by Serhii Kulibaba

Please share (http://devcenter.appery.io/documentat...) your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and provide us with the following information:

1) App name
2) Test credentials if login functionality is implemented in your app
3) Detailed steps to reproduce the issue


Apperyio.navigateTo doesn't work at the first moment

Posted: Sat Nov 28, 2015 11:17 am
by Paulo Fraga

The App name is: IonicApp
To test the app just click in "Login com Facebook" button

Step by Step:

Start test on the App.
On the Start Screen click on "Login com Facebook" button
The facebook login screen will start
Insert any facebook valid credential
After the login process the app still remains in the start screen, this is the problem.
If you click one more time on the button "Login com Facebook", the app will be redirect to the Register page.

The expected result is that after the first click and the sucess on the login process the app navigates to the result page.

Regards,
Paulo Fraga.


Apperyio.navigateTo doesn't work at the first moment

Posted: Tue Dec 01, 2015 10:02 am
by Andrew Peacock

Hi Sergiy,
There's definitely an issue.

I've just created a new project:

Screen1 - just has a text component with "screen 1" on it. In the init() function I added this:

setTimeout(function(){
Apperyio.navigateTo("screen2");
}, 100);

Screen 2 - just has a text component with "screen 2" on it.

The app never shows screen 1 and stops. Never gets to screen 2.

I've shared the app with support:
https://appery.io/app/projects/39eccd...

Regards,
Andy


Apperyio.navigateTo doesn't work at the first moment

Posted: Tue Dec 01, 2015 5:26 pm
by Serhii Kulibaba

Andrew,

JS is case-sensitive language.
You have page "Screen2", but use JS code with "screen2".
Please use JS below for that:
preApperyio.navigateTo("Screen2");/pre