Custom URL works in simulator but not on a device - ios

I went through and followed this tutorial to use Custom URL. Everything works as expected on Simulator, so when I use safari and hit myApp:// a dialog pops up asking if I wish to open the app. SO far so good. However, when I installed the app on a device and hit the same thing in safari I get an error saying Cannot open page. Safari cannot open the page because the address is invalid. I tried this enough times, so it's definitely not a typing error. Any help is greatly appretiated.
.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.xyz.myApp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>iOSMyApp</string>
</array>
</dict>
</array>
I copied my bundle identifier for CFBundleURLName.
ANSWER: So just before I was about to bang my head on the desk what I found that it's working when I open a new tab in Safari and then hit the app URL. And I have no idea why this happens. Also if you cancel it and then hit the app URL in the same tab again, it will give you an error I mentioned in the question. So the trick is to hit the app URL in a fresh tab everytime.

This setup is working for me. One thing I have to do is close the current tab of safari and open new one and type
iOSMyApp://

Related

Detailed Flutter Deep Links explanation?

I can't get any part of deep linking working in my Flutter app. None of the documentation I can find on this is anywhere near adequate. eg none mention this, but it appears https://developer.apple.com/documentation/xcode/supporting-associated-domains?language=objc that I need to provide a file on my server? Nor is there any discussion I can find of that or in what way I need to set up an associated domain.
May app on launch directs to the login page of a local copy of my website. Following login, my site redirects to myappname:mywebsite.
In my Info.plist, I have:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>mywebsite</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myappname</string>
</array>
</dict>
</array>
Following a tip from someone on reddit (as I say, this stuff isn't documented anywhere!), I added an associated domain in XCode applinks:mywebsite?mode=developer
I also redirected my domain in my local hosts file to my local machine. I've verified in the browser in the iOS simulator that the domain redirect is working in the simulator.
It appears from Apple's documentation that I should see a hit on my website to .well-known/apple-app-site-association but I get nothing.
My app successfully redirects on launch to the login page, but when I complete the login, my site issues a redirect to myappname://mywebsite but the browser in the simulator is just ignoring this.
I opened the console on the device browser from Safari, but nothing is reported.

How to make deep links work in flutter when opened with gmail?

I am trying to implement deep linking in my flutter app. I am using the uni_links flutter package.
I am sending the deeplink for my application to the user's email account. However, in gmail, you need the http protocol in the href value, Otherwise gmail will not consider that as a valid link. Hence I am forced to use the following link in the email :
Click here
as opposed to a link like,
Click here
Now with https://myexample.flutter.dev, when I open the link from gmail, it doesn't open my app.
But, if I change my CFBundleURLSchemes key to myexample and CFBundleURLName to flutter.dev, when I type in myexample://flutter.dev in my browser, it opens my app. However, like I mentioned before, this is not recognized as a valid link in gmail.
What is the issue here? How do I resolve this?
Here's my ios/Runner/Info.plist :
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>myexample.flutter.dev</string>
<key>CFBundleURLSchemes</key>
<array>
<string>https</string>
</array>
</dict>
</array>
The first one is custom link you can do it by yourself
Click here
The second one is universal link
You need to provide file on the backend side to make it work.
Universal Links only work with https scheme and require a specified host, entitlements and a hosted file - apple-app-site-association.
Click here
UniversalLinksDocumentation
PS. I think right now as the end of the 2020 the best way to handle deeplinks is by Firebase Dynamic Links. Maybe future people will consider it it should be much more easier

Uber native login flagging error

I am currently running the example codes provided by Uber SDK (Objective C version).
I encounter a problem when I clicked on the Native Login and Ride Request Widget Button provided by the Objective C example.
After setting up the app in Uber and also copied the Client ID to the info.plist, I counter the error below:
When I click at the Ride Request Widget Button, the app will load a new view with the "Ride there with Uber" button. After clicking the "Ride there with Uber" button, the example app will flag a UIAlert with a message of "There seems to be a problem connecting to Uber. Please go back to AppName and try again". What could be the problem?
Btw, I fill in the redirect URL as "myapp://oauth/callback" on both the dashboard and the app info.plist.
Anything I miss out during the setup of this example?
Thanks.
Make sure the URL Scheme in Targets > Info is set to something like sampleApp, and not sampleApp://uberSSO. This solved my problem.
For reference, here is the snippet from the Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>MySampleAppName</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sampleApp</string>
</array>
</dict>
</array>

CFBundleUrlTypes visible in the Info.plist but not in the XCode view of it

I am debugging my integration of Facebook iOS SDK 4.10 on iOS 9 (it works but the login is always done through a webview and doesn't open the Facebook app).
I have a problem with CFBundleUrlTypes, I have added it (many times) through XCode: Project > Info > Url Types... In fact it is persisted, because I can: cat Info.plist|grep -C 10 -i urltypes and get:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string></string>
<key>CFBundleURLSchemes</key>
<array>
<string>fb$(FACEBOOK_APP_ID)</string>
</array>
</dict>
</array>
But I relaunch XCode it's not visible anymore in the project info.
Starting from iOS9, Facebook uses the Safari View Controller for Login rather than a fast app switch. The SDK basically tries to determine the best possible experience for the user so this is probably why you are always routed to the web based login.
It is also partly to get around the "APPNAME wants to open OTHERAPP" you will see in iOS9.
The documentation slightly touches on this here https://developers.facebook.com/docs/ios/ios9#faq

Opening a jpeg image from mail app into my iOS app

I was trying to implement this functionallity for the first time, and seemed pretty straight forward, but for some reason is not working for me.
My intention is to open a simple jpeg from the mail app into my application, after that was not working I was just trying to open any kind of document by adding this to the Info.plist.
Same result, my application is not appearing on the list of "Open with..."
<key>CFBundleDocumentTypes</key> <array>
<dict>
<key>CFBundleTypeName</key>
<string>All Docs</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>public.content</string>
</array>
</dict> </array>
I have search already in StackOverFlow and the apple docs, but none of the answers make it work for me, so maybe is something simple that I am missing here...
Why is my iOS app not showing up in other apps' "Open in" dialog?
How do I associate file types with an iPhone application?
How I am testing it (maybe has to do with this):
Have an email with an attachment. Add the settings to the plist and the run the application on my device, hoping that the next time I open the mail app and click on the attachment my app will be on the list.
Well, it seems that is not possible. At least to provide a custom way to open images from the mail app. There is no problem if is from another place, but apple has limited the options on the mail app so we would use the "copy" option as a workaround.
Update:
This question goes in the same direction.
It is now possible to open images from the mail app, it's just somewhat convoluted:
Tap and hold the image.
Tap on Quick Look so the image goes fullscreen.
Tap the image to show the top toolbar.
Tap the open in button at the top right.
Scroll the list to the left to find your app.

Resources