I'm looking for a way to uncover directory paths in an iOS app, for the purposes of deep linking.
Right now, I know that I can unpack an app's info.plist file and look for the "CFBundleURLScheme." This parameter usually looks like this:
CFBundleURLTypes = (
{ CFBundleURLName = "BUNDLEID";
CFBundleURLSchemes = ( "scheme", "fb1234567891011" );
},
);
From here, I can construct a basic URL scheme to launch the app to the home page, by appending "://" to the end of one of the "CFBundleURLSchemes."
If I enter scheme://
into Safari's URL bar and hit enter, then the app will launch on my iPhone to the app's homepage.
However, there is another deep link I know works - scheme://upgrade/pro- This links to a specific in-app directory, and when launched in Safari, opens the app directly to the upgrade page.
I want to be able to find a list of in-app directories that I can append to the basic URL scheme to be able to link to actual in-app pages.
Is there a file somewhere in an app's bundle or Payload folder that has a list of defined directory paths?
I hope that made sense, thanks in advance for any guidance!
No. The URL goes to an entry-point in the app that is parsed by code. Each app can do it how it wants. It could just be a bunch of if/else statements.
Best bet is to ask the developer -- if they made these entry-points, they probably want people to know about them.
Related
Project workspace
Mobile Project: ReactNative 0.64.3 / Expo with Managed Workflow / IOS 14.6 / NPM
Sharing Library: ReactNative's default Share library.
Website/Domain: Statically hosted via S3, single page app built with TS/Gatsby. Caching handled with CloudFront.
Synopsis: I'm using universal links and query params to allow my users to share tickets. The Universal links are being stripped of all route params and query strings when the link is shared by the native sharing dialog. Using the COPY/PASTE function in the native sharing dialog always copies a complete link, which can be pasted anywhere and used successfully to open the app. The EMAIL option also works, opening Mail with the correct url string and autofilled as expected. The problem arrises when I try to share the link via iMessage. I'm running the project on an iPhone as a fully deployed Apple Testflight standalone app.
The app does download the AASA file on app install, which is statically hosted via an S3 bucket. I have verified its availability via postman and the online AASA validator here https://branch.io/resources/aasa-validator/
The app always opens when opening a valid universal link, such as when I manually type it into iMessage or other sharing medium -- email, etc. Because of this, I'm inclined to believe I have a problem with where the link string is being generated rather than the AASA system.
const ticketShare = (ticket: Ticket) => {
const link = Linking.createURL("www.sample.com/share_ticket", { //Expo Linking library
scheme: "https",
queryParams: {
...ticket
}
}).replaceAll("%25", "%"); //double encoding problem I have yet to properly fix.
console.log("link: ", link); //always the correct url here.
Share.share({ url: link }); // request to open the native sharing dialog activity. ('url' for ios)
};
Correct url is something like:
https://www.sample.com/share_ticket?my=query¶ms=here
Stripped url is something like:
https://www.sample.com/
sharing dialog image.
https://www.sketchappsources.com/resources/source-image/simple-share-actionsheet-ios-13-hugo.png
"COPY" actions always copy the correct url, "MAIL" works as well.
Using "MESSAGE" or any of the "recent" actions in the top row fails, sharing the base url only.
The title and website abbreviation at the top of the action sheet do render properly, pulling metadata/images from the website.
To make it more complicated, the share function does yield the correct url directly after a fresh install, but then never again. Console.logs always log the correct url.
I have tried react-native-share's library with the same results. (Wraps the same native bridge code?)
I have checked the react-native github page for issues related to this with no result. I have combed StackOverflow for a few days without results. Usually that means its something simple.. here's to hoping.
Anyone out there run into this issue? Thanks!
I've found two options to open my app from a Safari web page: a custom URL scheme created in my app project's Info.plist or Apple's Universal Linking. Obviously the custom URL scheme is the easiest one to set up, but the problem I'm having with this is that Safari shows a confirmation window asking "Open myapp?" first and the user has to tap OK before the app actually opens. I want my app to open automatically as the scheme is opened, and I'm being told the only way to do this is through Universal Linking (please correct me if this is not true). If this is true, however, I would like to know if it's possible in any way to put the required apple-app-site-association file on a http:// domain instead of https://? According the official Apple documentation the format of a correct Universal Link starts explicitly with https:// but my domain name can't be loaded on https:// without redirecting a few times and that messes up the web services I've written to execute other tasks in my app. The two main questions I'm left with after this issue:
1) Is it really impossible to work around the confirmation prompt using a custom URL scheme (myscheme://)? If it's not impossible, how can I do this?
2) If I have to use Apple Universal Linking, can I use a http:// domain? If so, how do I do it? Right now if I load up the universal link, it just shows the dictionary inside the apple-app-site-association file, which I'm pretty sure is not supposed to happen. I'm told it's supposed to send a NSUserActivity object to my app delegate. How can I accomplish this with a http:// link?
It is not possible to trigger a custom URI scheme without showing an alert to the user. This used to be possible in iOS 8, but iOS 9 started showing the alert for all apps. And iOS 10.3 has extended that even to the App Store itself. You cannot bypass this. Universal Links were created to replace URI schemes for this behavior, so you do need to use them instead.
From your description, I believe you may be misunderstanding how Universal Links work. To answer the literal questions you asked first, no the Universal Link URL itself does not need to be on the https:// protocol, and yes, the apple-app-site-association must be served over https:// without redirects.
However, it sounds like you're trying to serve the content of the apple-app-site-association file for every Universal Link. That is not the correct implementation — the AASA file is hosted only at https://example.com/apple-app-site-association, and iOS automatically retrieves it when the app is installed. After that, any URL on example.com that matches the criteria in the AASA file will be eligible for Universal Links.
All of that said, you really don't want to built out this system on your own. I suggest looking into Firebase Dynamic Links or Branch.io (full disclosure: I'm on the Branch team).
Is it really impossible to work around the confirmation prompt using a custom URL scheme (myscheme://)? If it's not impossible, how can I do this?
That is possible with some hacky tricks and BAD user experience. It requires user to press "add to home screen" button, so I don't recommend this solution in most cases.
set your app scheme like myapp
create the following html file and put it into the web
window.onload = function() {
if (("standalone" in window.navigator) && window.navigator.standalone) {
window.location.href = 'myapp://open'
}
}
open the html file with safari and "add to home screen"
open the home screen icon and your native app will launch
The point is the meta tag.
<meta name="apple-mobile-web-app-capable" content="yes" />
Without this, safari will launch and confirmation prompt will appear.
How to Open an iOS App using Firebase Dynamic Links and Pass or get Parameters To an App Via Custom URL Scheme in iOS(swift)?
for eg :- https://q3tyj.app.goo.gl/abcd
My URL Scheme is ‘q3tyj.app.goo.gl’ in iOS app in Url Types.
If I type q3tyj.app.goo.gl in safari, I am able to open the application. But if I type q3tyj.app.goo.gl with some extra parameter like https://q3tyj.app.goo.gl/abcd in safari, , I am not able to open the application.
please also explain me how to get “link” parameter (which associated with dynamic link) from dynamic link in iOS app ( Swift ) .
I followed steps which were mentioned in Firebase.google.com for iOS ( Swift ).but its not working.
Thanks,
Nirav Virpara
It's hard to know exactly where your error is, but a few things to help you debug:
If you go to https://q3tyj.app.goo.gl/apple-app-site-association, you should see some JSON that points to your app. If you don't see this, make sure you've entered your team ID and your App Store ID in the project settings in the Firebase console
Make sure you're using your Bundle ID, not the shortlink domain, as your custom URL scheme in Xcode
Make sure you've enabled Associated Domains in the Capabilities tab of your Xcode project, and your domain looks like applinks:q3tyj.app.goo.gl
Universal Links (and, therefore, Dynamic Links) generally don't work if you type them directly into the Safari address bar. Instead, try typing the URL into an app like Notes and then clicking on them from there.
Good luck!
If you type https://q3tyj.app.goo.gl/apple-app-site-association this link in your browser and check, you will end up seeing a json, meaning your apple-app-site-association is correctly configured on your google website. However, you need to make sure that teamid in your google console or appid is correct.
In my app i am opening documents via UIDocumentInteractionController. if no apps is installed in device we want to navigate to app store.In that place i want to navigate to document viewer related apps page.
if anyone can suggest me.
You can open the App Store to an app page by getting the app page url. On iOS, you can go to the app page, click share and copy the url.
Then, you can open it like this (Swift) :
let theURL = NSURL(urlWithString: "app url here")
UIApplication.sharedApplication().openURL(theURL)
If that answers your question.
All you have to do is use iTunes search query and it will navigate to a an 'app like' visual:
http://itunes.com/Dropbox
Where 'DropBox' is your search term. This is what it looks like on device :
Or you can do it to a specific category:
http://itunes.apple.com/genre/mobile-software-applications/id6002?mt=8
To launch app page in App Store app on iOS 7, this URL format is required:
#"itms-apps://itunes.apple.com/app/id%#"
Can you also append the affiliate ID and campaign token to this URL like this?
#"itms-apps://itunes.apple.com/app/id%#&at=%#&ct=%#"
Or does it have to be a plain
#"https://itunes.apple.com/app/%#/id%#?mt=8&uo=4"
type URL like you do in websites? Disadvantage of this URL is it opens Safari and causes redirects.
Try it and see; the link will either open or it won't, and if it does, and if you specify a custom campaign for testing, it will either show up in PHG or it won't. Let us know what happens, as I'm curious myself.
Oh, and if it doesn't, please file a bug, as that seems like a useful feature, and it should be trivial for Apple to add it if they haven't already.