[SOLVED] - Sign In with Apple no popup in Xcode

Implemented quave:accounts-apple as follows:
Meteor 1.10
init.js:

ServiceConfiguration.configurations.upsert(	  
	  { service: "apple" },
	  {
	    $set: {
          nativeClientId: "myappid#",
          clientId: "com.mysiteurl",
          teamId: "myteamid",
          keyId: "mykeyid",
          secret: "-----BEGIN PRIVATE KEY-----\n ...text...  \n-----END PRIVATE KEY-----",
          redirectUri: "https://mysiteurl.com:443/_oauth/apple",
          scope: "name%20email",
          responseMode: "form_post",
          responseType: "code",
          service: "apple",
	  loginStyle: "popup"
        }
	  }
	);

I also added the following as an event in the atForm:

'click #at-apple': function(){
        Meteor.loginWithApple({
            requestPermissions: ['name', 'email'],
          });
    }

but this doesn’t seem to make a difference one way or another.

Facebook, Twitter, Google oauth work aok.

In Safari, this generally works ok (I can’t login successfully, but I do get the popup and prompt with the correct wording for “register” vs “sign in”):


But after running the build command and opening the project in Xcode, when I run the app in Simulator, I get no popup upon pressing the button and the button reads “Configure Apple” only. I did add “Sign in with Apple” in Signing & Capabilities but not sure if additional configuration is required there?


Hi @alschwar,

I replied to you in Stackoverflow. (Apple Sign In not working in Xcode, Simulator (IOS) - Meteor Cordova build. It works ok in Safari pre-build (web/js only) - Stack Overflow)
I understand that you added the package and observed no changes.

Safari and Cordova are completely different beasts. What you call a pre-build, in my understanding, is your web client bundle. Where it is not working for you is inside your Cordova app.

I asked you if a Cordova package was used in the Meteor packages that your make use of because I believe you cannot do the Sign in with Apple workflow without native components (a Cordova plugin).
The point was not to just add the package but to see if a package is in use. A package would not only need to be added but its API needs to be integrated with the Meteor methods.

In this conversation I haven’t seen a successful confirmation for Cordova so this might have not been completed. Planning on Adding Sign In With Apple? - #19 by jramer
I will copy some of those contributors to see if they have some info on this.

@jramer @filipenevola @mryoda

1 Like

Thank you @paulishca, I really appreciate your clarifying for me - I’m definitely more hobbyist than pro like so many of you here are!
The main reason I’m adding in the functionality is that in order to publish to the App Store, Apple is requiring me to include Sign In with Apple because I have other OAuth sign in’s (google, twitter, facebook). My only alternative is to remove those from the ios version of the app.
You are correct that the “pre-build” is the web client bundle (simply executing meteor).
I’m not sure how I can check if the API is being integrated with Meteor methods but if you or someone can suggest where to look, I’m happy to.
I am curious if the different wording on the “post-build” button is a clue? Why “configure” post-build but “register” or “sign in” in the web client bundle?

Just wanted to add that the same issue exists in Android Studio for me. So it is not limited to Xcode.

Hello @alschwar, how are you doing?
Can you provide a repo to reproduce this one?
have you tried your app in (TestFlight)[TestFlight - Apple Developer]?

1 Like

Hey @grubba thanks for checking in on this! And a huge thanks to @jramer and quave (not sure who to @ for quave?) for making this possible!
I did get it working after fixing part of the service config - I mistakenly put the numeric app id for “nativeClientId” but apparently that should be the wording you set like “com.mysiteurl” when you build the app id on the apple developer portal. And then “clientId” setting is what you create in the Services Id (be sure to check out that link provided in the atmosphere packages that shows you how to get the Apple developer elements setup correctly.
And also adding in an npm package may have helped some: GitHub - twogate/cordova-plugin-sign-in-with-apple: A native-implemented plugin of Sign in with Apple // Thanks to your contribution! // Cordova>=8 iOS>=13
I’m not 100% sure that npm pkg is needed, and it may have already been added via quave, but I added it explicitly and made this change:

ServiceConfiguration.configurations.upsert(	  
	  { service: "apple" },
	  {
	    $set: {
          nativeClientId: "com.mysite", //this is for mobile
          clientId: "com.mysite.client", // this is for web
          teamId: "{my apple team id #}",
          keyId: "{my apple app store key id}",
          secret: "-----BEGIN PRIVATE KEY-----\nabc123\ndef456\nghi789\n-----END PRIVATE KEY-----",
          redirectUri: "https://mysite.com/_oauth/apple",
          scope: "name%20email", //this doesn't seem to do anything, but keeping it in for now...
          responseMode: "form_post",
          responseType: "code",
          service: "apple", // this is probably redundant but keeping it for now...
	        loginStyle: "popup"
        }
	  }
	); 

e
and I am now up and running on the app store!

One important note for anyone doing this in the future - Apple made me change “Register with Apple” to “Sign up with Apple”.

Also, just fyi, I found I didn’t need to use:

  Meteor.loginWithApple({
    requestPermissions: ['name', 'email'],
  });

Thanks again to all!

2 Likes