iOS Question Closed? B4XPages Firebase Sign in with Google

Robert Valentino

Well-Known Member
Licensed User
Longtime User
My first B4i program and I am trying to do this example (FirebaseAuth) in B4XPages and keep getting this error when i do the

B4X:
    LogInPage.Initialize("Page1")                         '  I create this dummy page just to try and get the logon screen to show.  Can we use B4xMainPage?         
    LogInPage.Title = "Page 1"
'    LogInPage.RootPanel.LoadLayout("1")
    NavControl.ShowPage(LogInPage)

mFirebaseAuth.SignInWithGoogle(LogInPage)

I believe I set everything up right at the firebase site.
B4X:
Application_Start
cBBsGlobals::Initialize
Packagename: BBs.Viewer
cFirebase::Init
cFirebase::StartFirebase - Start FirebaseAuth
cFirebase::StartFirebase - No one signed in
Application_Active
cFirebase::SignUserIn - Signing User In
Error occurred on line: 540 (cFirebase)
-[b4i_main view]: unrecognized selector sent to instance 0x283122370
Stack Trace: (
  CoreFoundation       E2F84645-2905-31EF-8EC7-3CC19C3CDDB3 + 626960
  libobjc.A.dylib      objc_exception_throw + 60
  CoreFoundation       E2F84645-2905-31EF-8EC7-3CC19C3CDDB3 + 1532100
  CoreFoundation       E2F84645-2905-31EF-8EC7-3CC19C3CDDB3 + 189732
  CoreFoundation       _CF_forwarding_prep_0 + 96
  BBsViewer            -[OIDExternalUserAgentIOS presentationAnchorForWebAuthenticationSession:] + 28
  AuthenticationServices              0x00000001bdb82200 925CB21F-1CC1-33FF-B298-1680D2624232 + 131584
  BBsViewer            -[OIDExternalUserAgentIOS presentExternalUserAgentRequest:session:] + 388
  BBsViewer            -[OIDAuthorizationSession presentAuthorizationWithExternalUserAgent:callback:] + 124
  BBsViewer            +[OIDAuthorizationService presentAuthorizationRequest:externalUserAgent:callback:] + 128
 BBsViewer            +[OIDAuthorizationService(IOS) presentAuthorizationRequest:presentingViewController:callback:] + 140
 BBsViewer            -[GIDSignIn authenticateInteractivelyWithOptions:] + 644
 BBsViewer            -[GIDSignIn authenticateWithOptions:] + 80
 BBsViewer            -[GIDSignIn signInWithOptions:] + 496
 BBsViewer            -[GIDSignIn signIn] + 68
 BBsViewer            -[iFirebaseAuth SignInWithGoogle:] + 140
 BBsViewer            -[ResumableSub_cfirebase_SignUserIn resume::] + 4020
 BBsViewer            -[b4i_cfirebase _signuserin:::] + 540
 BBsViewer            -[ResumableSub_main_Application_Start resume::] + 1348
 CoreFoundation       E2F84645-2905-31EF-8EC7-3CC19C3CDDB3 + 140196
 CoreFoundation       E2F84645-2905-31EF-8EC7-3CC19C3CDDB3 + 260980
 BBsViewer            +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1300
 BBsViewer            -[B4IShell runMethod:] + 448
 BBsViewer            -[B4IShell raiseEventImpl:method:args::] + 2172
 BBsViewer            -[B4IShellBI raiseEvent:event:params:] + 1580
 BBsViewer            -[B4IDelegatableResumableSub resume::] + 380
 BBsViewer            -[B4I checkAndRunWaitForEvent:event:params:] + 428
 BBsViewer            -[B4IShellBI raiseEvent:event:params:] + 1436
 BBsViewer            __37-[B4ICommon ReturnFromResumableSub::]_block_invoke + 264
 libdispatch.dylib    BD02A625-8475-3FD6-8DC3-8AED25D1573B + 10532
 libdispatch.dylib    BD02A625-8475-3FD6-8DC3-8AED25D1573B + 18032
 libdispatch.dylib    _dispatch_main_queue_callback_4CF + 944
 CoreFoundation       E2F84645-2905-31EF-8EC7-3CC19C3CDDB3 + 335236
 CoreFoundation       E2F84645-2905-31EF-8EC7-3CC19C3CDDB3 + 48988
 CoreFoundation       CFRunLoopRunSpecific + 600
 GraphicsServices     GSEventRunModal + 164
 UIKitCore            920A0EE6-D266-3058-8144-27A27B23AD62 + 5346768
 UIKitCore            UIApplicationMain + 364
 BBsViewer            main + 96
 dyld                 start + 520
)
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
OK, I changed
B4X:
mFirebaseAuth.SignInWithGoogle(LogInPage)
to
mFirebaseAuth.SignInWithGoogle(B4XPages.GetNativeParent(Me))
and now I get this
B4X:
Application_Start
cBBsGlobals::Initialize
Packagename: BBs.Viewer
cFirebase::Init
B4XPage_Created
B4XPage_Created - smainmenu
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
cFirebase::StartFirebase - Start FirebaseAuth
cFirebase::StartFirebase - No one signed in
cFirebase::SignUserIn - Signing User In
error signing in: Error Domain=com.google.GIDSignIn Code=-5 "The user canceled the sign-in flow." UserInfo={NSLocalizedDescription=The user canceled the sign-in flow.}
B4XPage_Resize
CreateScreen
cFirebase::FirebaseAuth_SignedError  Exception:The user canceled the sign-in flow.
B4XMainPage::ShowData
Standing:Created Test League  ID:5430
Application_Active
Application_Inactive
Application_Active

Never saw the log on screen and didn't cancel anything
 
Upvote 0
Top