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!