iOS auth not returning new user back to the app

I have integrated auth in the iOS and it works fine and redirects the user back once logged in but if I create a new user while doing the auth, it just redirects the user to the user Home inside the browser (showing Home, ID, Settings etc) and does not return the user back to the iOS app.

I am using Blockstack-webapp for redirection.

@shreyas any pointers?

@hammadtariq Apologies for our slow response. Were you able to resolve this issue or are you still seeing this?

No problem at all. It’s still there, in fact, I will be finalizing my app in a couple of days as rest of the functionality is almost complete and I am worried about iOS app store testing as they can reject the app due to the incomplete functionality. Is there any way I can fix this?

Just to confirm, I am using this branch for development:

pod 'Blockstack', :git => '', :branch => 'multiplayer_support'

@hammadtariq apologies for not getting back sooner, I’m not sure how I missed this. Are you handling the redirect URL? In the Blockstack-webapp example, it is: window.location="myblockstackapp://?authResponse=" + authResponse, so you should replace myblockstackapp with your app’s registered value.

Also, I don’t believe the App Store will reject your app because of this. Though it should still be fixed. And I recommend updating to the latest version of the SDK, there’s been many changes and fixes :).

No worries @shreyas yes, I am handling redirect-URL as my sign-in is returning fine. What happens is that browser is not return the user back if he/she is registering for the first time, it just opens the default user home page after registering the user.

I will integrate the new version once the app is ready, right now I am in QA phase so I want to know that it works fully for once and then I can go on to change the version.

Just as a side question, is there anyway to get the user’s profile picture in new version?

@shreyas I updated the pod to latest 0.3.0 and the issue resolved itself. Thanks for the good work!

1 Like

@hammadtariq Glad to hear – I couldn’t reproduce the issue :). Also, in the latest version of the SDK there is a new field, image, on the Profile object. You can access it like this: Blockstack.shared.loadUserData().claim.image.

NOTE: If you had retrieved and stored user data using a previous version of the SDK, the image field may be empty. This is a known issue. Logging out and back in, or reinstalling the app will fix this.

Also, the latest SDK version should be 0.4.0. Is this not the case?

Hey, thanks @shreyas. It’s coming as 0.3.0, I just checked it again by running pod install. About the image and the email, thank you very much for those, they were much needed!

@shreyas the image is part of 0.4.0? I just tried using pod 'Blockstack', '~> 0.4.0' that didn’t work, also claim. does not have any image.

Yep, it’s part of 0.4.0. Cocoapods says the version that is live is v0.4.0 ( Try pod update.

@shreyas thanks that did the trick (many breaking changes though :)) I was able to update everything. Then signed the user out and signed back in, found claim.image but it is nil while I have an image set for this particular profile. Is there anything I can do to fix this?

@hammadtariq perhaps that is a bug. Try uninstalling and reinstalling the app please!

@shreyas tried doing that its still nil, in fact also tried resetting the keychain using Blockstack.shared.promptClearDeviceKeychain(), it gives the invalid address error, I have attached a screenshot.

I was trying to reset the keychain because that problem where just the using the iOS sdk was overwriting the profile of the user (discussed here) was coming back.

That reset did work actually instead of giving that error.

However, then I ran into another problem when I created a new blockstack ID to test using the desktop browser, when I restored into the iOS simulator, the sign in work but it is giving Blockstack.shared.loadUserData()?.username and Blockstack.shared.loadUserData()?.claim as nil.

So, these are basically 3 different problems. :slight_smile: Let me know if you need any more information or if you are not able to reproduce them.

I was basically hoping to use newly formed test IDs to submit as part of my submission to the app store. However, seems like I will have to find a work around.

@shreyas app store just rejected my app giving this reason:

Your wallet app facilitates the transmission of a virtual currency but was submitted by an Apple Developer Program account registered to an individual, which is not appropriate for the App Store.

Next Steps

Your wallet app must be published under a seller name and company name that reflects the Blockstack name.

The screenshot they provided with the rejection is this:

They somehow went there during the Signup, most definitely while trying to create a new ID and they got redirected to the user home at the end of the auth. I am simply returning the auth using the default web app redirect. The namespace I am using timski:// and it generally works 100% of the time if I am just signing in.

The issue they got is what I have seen once as well. I am not sure what to do now. Should I appeal and say this is not a wallet app and you are just seeing the default homepage of a Blockstack ID and you should try to sign in again? Otherwise, how can we fix this?

@hammadtariq Looking into the above mentioned issues. I’ll have more info for you by tomorrow. Really appreciate the detail you have provided.

Regarding the rejection, that is definitely bizarre. I’d say appeal the submission and tell them this is not a wallet app, and the given screenshot is not part of your app. It is a web component of the authentication tool that is visible to the user during authentication only. I think that should work–I have appealed rejections before and they have indeed reconsidered.

Thanks @shreyas. I appealed the same night and indeed they changed the app status again to “in review” within half an hour where it is stuck from last 48 hours. Fingers crossed for now. :slight_smile:

1 Like