Custom code login working with Android but not iOS

Hello,

I am using custom code to log a user in to my app. I had raised a previous support ticket which helped me to get the code working - Custom code login help needed

The problem I have is that this is failing for users on iOS device. The code is exactly the same for both

I have 2 questions:

1 - is there anything in this code that you would think means that login would fail for iOS users?

2 - i would like to return the error information as a variable in UI Builder so I can troubleshoot what the error is. How would I do that? I thought ā€˜return errorā€™ on line 50 but this isnā€™t working.

Thanks

Hello @Luc_Zentar!

Could you provide an error message when logging in on iOS?

Regards,
Alexander

Hi Alexander, I donā€™t know how to access this. Where would I see the error message?

I was thinking of returning it from the custom code and setting it as a variable and then emailing this to myself. But Iā€™m sure thereā€™s an easier way.

What exactly happens when you try to log in on an iOS device?

Regards,
Alexander

@Alexander_Pavelko

The biometric login prompt disappears and the screen stays as it is

Thank you.
Could you please check the last login timestamp?
Perhaps the user is able to log in, but is not redirected.

Regards,
Alexander

@Alexander_Pavelko

I have checked and the user is not being logged in

Thank you.
Could you please check the real time logging for a login error?

Regards,
Alexander

I have opened real time logging and tried to login, nothing shows on the real time log

Could you please provide your appID?

Regards,
Alexander

@Alexander_Pavelko

App ID - 9144D969-8CEB-81F4-FF84-987167CF6800

Container - mobileApp

Page - landing

I have also had this assistance from GoNative

On the GoNative side it is possible the gonative.auth module is not loaded when you are calling the status function. Try adding this within a gonative_library_ready() function. See the section on ā€œCalling Commands on Page Loadā€ JavaScript Bridge Overview

Regarding the JavaScript you are using to facilitate the login it is likewise possible that function is not yet loaded so you could check it is available before calling.

iOS and Android both vary across devices on these points.

Thank you, have you tested the code as recommended by GoNative yet?

Regards,
Alexander

@Alexander_Pavelko

I am trying but donā€™t fully understand where to put this function.

Would I add the function to my existing custom code? Or a new custom code function?

Perhaps a new test page with only the code we need will be useful.
But first, could you check if the logs will be in real time logging if you login with android (or other successful way)?

Regards,
Alexander

@Alexander_Pavelko

This is the log when Android login is successful

Great! So, if there was an error when logging from iOS, it would also be logged.
I think you need to make changes to the code based on the recommendations you received from GoNative and test this case.

Regards,
Alexander

@Alexander_Pavelko

Thank you for your help so far.

I have been able to identify the error and it seems to be with Backendless and not GoNative.

The error message is - Login by object id is allowed only for Code Runner API key

This is only a problem with iOS devices and not Android. Do you have an idea why this is happening and how it can be fixed?

Thanks

Hi @Luc_Zentar ,

One more question for clarification. On which side (client or server) login by ID is performed?

Regards, Andriy

@Andriy_Konoz sorry I donā€™t understand how to answer the question. I am using custom code block in UI builder and this is the code:

@Luc_Zentar ,

Do you use Backendless Viewer to interact with your code?
I do not fully understand how your bio-metric login can use code which you provided.

The reason of the problem here is that some code uses ā€œlogin user by IDā€ in the wrong place and I am now trying to localize this place :slightly_smiling_face:

Regards, Andriy