Auth Login Callbacks not firing on iOS (EOS-SDK-CSharp-39599718-v1.17.0), but same callback fire on Android and Windows...

As mentioned I’ve downloaded the EOS-SDK-CSharp-39599718-v1.17.0 SDK, which has C# bindings for Android, iOS, Windows, macOS and Linux. So far I’ve managed to get a cross-platform implementation working with both Windows and Android. I’m now hitting a callback issue with iOS.

  1. The PlatformInterface appears to be working correctly, so I know that the EOSSDK.framework etc is being loaded correctly.
  2. I can see that logging callbacks are hooked up and working, as I can hit that break-point in that callback and see, the following output:

[EPIC] Default Network Status: EOS_NS_Online

[EPIC] [Boot] EOSSDK Version 1.17.0-38100716 booting at 2025-03-23T10:55:35.657Z using C

[EPIC] [Boot] EOSSDK Platform Properties [OS=IOS/18.3.2, ClientId=x…, ProductId=9…, SandboxId=c…, DeploymentId=0…, ProductName=SomeGame ProductVersion=1.61, IsServer=false, Flags=None]

[EPIC] Start Session (User: …)

[EPIC] Overlay loaded and initialized

EPIC] Record Event: SDKOverlayComponent.Init <Redacted>

all the IDs etc redacted for obvious reasons :slight_smile:

So when I try to login, the call definitely happens, but I never get the Web page pop-up to sign into my Epic acount, and therefore no call backs. My setup is:

var presentationContextProvider = new PresentationContextProviderToSharedKeyWindow();

      IOSLoginOptions loginOptions = new IOSLoginOptions

      {

        Credentials = new IOSCredentials

        {

          Type = _loginCredentialType,

          Id = loginCredentialId,

          Token = loginCredentialToken,

          SystemAuthCredentialsOptions = new IOSCredentialsSystemAuthCredentialsOptions

          {

            PresentationContextProviding = presentationContextProvider.Handle

          },

        },

        ScopeFlags = AuthScopeFlags.BasicProfile,

      };

 _authInterface?.Login(ref loginOptions, null, onLoginCallBack);

where onLoginCallBack looks like:

private void onLoginCallBack(ref LoginCallbackInfo loginCallbackInfo)
        {
            if (loginCallbackInfo.ResultCode == Epic.OnlineServices.Result.Success)
            {
                System.Diagnostics.Debug.WriteLine("[EPIC] Login succeeded.");

                _epicAccountId = loginCallbackInfo.LocalUserId;

                // check ownership
                if (_checkOwnsership)
                    CheckOwnership();
                else
                    Login();
            }
            else
            {
                Fail("[EPIC] Failed to login: " + loginCallbackInfo.ResultCode, false);
            }
        }

the PresentationContextProviderToSharedKeyWindow class looks like this and it’s GetPresentationAnchor method, is never called by EOS:

private class PresentationContextProviderToSharedKeyWindow : NSObject, IASWebAuthenticationPresentationContextProviding
        {
            [Export("presentationAnchorForWebAuthenticationSession:")]
            public UIWindow GetPresentationAnchor(ASWebAuthenticationSession session)
            {
                if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0)
                && UIApplication.SharedApplication.ConnectedScenes != null)
                {
                    foreach (var scene in UIApplication.SharedApplication.ConnectedScenes)
                    {
                        if (scene is UIWindowScene windowScene)
                        {
                            foreach (var window in windowScene.Windows)
                            {
                                if (window.IsKeyWindow)
                                {
                                    return window;
                                }
                            }
                        }
                    }
                }
                else
                {
                    // Fallback for earlier versions - Use KeyWindow
                    return UIApplication.SharedApplication.KeyWindow;
                }

                // If no key window is found, throw an exception or log an error
                throw new InvalidOperationException("No key window found.");
            }
        }

I believe I followed everything mentioned in the iOS documentation. Can anyone spot what I might be missing? I feel I’m very close, but can’t see the woods for the trees right now :slight_smile:

Hi, there are some unique issues to be aware of when using the SDK on macOS and iOS. If you’re seeing problems with callbacks, I would ask you to check that you’re using the CoreFoundation run loop. I’ve included a mac example below, but this should be very similar for iOS.

// MAC EXAMPLE

// Instead of:

while (true) {

EOS_Platform_Tick(platformInterface);

}

// You should use something like:

while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, true)) {

EOS_Platform_Tick(platformInterface);

}

// Or, this:

while ([[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.05]]) {

EOS_Platform_Tick(platformInterface);

}

Thanks James, I’ll be giving this a try.