iOS auth not returning new user back to the app


#1

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?


#2

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


#3

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 => 'https://github.com/blockstack/blockstack-ios.git', :branch => 'multiplayer_support'

#4

@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 :).


#5

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?


#6

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


#7

@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.


#8

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


#9

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!


#10

@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.


#11

Yep, it’s part of 0.4.0. Cocoapods says the version that is live is v0.4.0 (https://cocoapods.org/pods/Blockstack). Try pod update.


#12

@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?


#13

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


#14

@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.


#15

@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?


#16

@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.


#17

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: