简体   繁体   中英

How can I pass data through the App Store to a downloaded app?

I am trying to incorporate a sharing feature for my mobile app which should be for both Users with the app, and without the app.

When a User without the app clicks on a Universal Link, I want to navigate the User to the App Store passing along some data. When the User installs the app, I want to them extract the data.

Here's a flow diagram to explain this further:

在此处输入图片说明

Is it possible to pass data from a link, to the App Store then eventually on to the User.

The right hand side of the flow works perfectly.

查看Firebase 动态链接- 它为此提供了一些解决方案。

You have one delegate method which will help you to handle the hand-off after the user installs the app.

Implement this method and when user will open the app you will have reference to the universal link through userActivity :

 func application(_ application: UIApplication,
                  continue userActivity: NSUserActivity,
                  restorationHandler: @escaping ([Any]?) -> Void) -> Bool { // you will pass universal link with params and will parse it here
   if let url = userActivity.webpageURL {
      // after parse call your appropriate view controller with data 
   }
}

yes I done with my project and its work both scenario with https://www.appsflyer.com/ . its provide what exactly you looking for.

Well,

It will be a little long but I'll try to explain one by one.

firstly, you can do with firebase dynamic link , but you want to do manually(Not SDK option.) So, I will try to explain firebase workflow.

First of all, you need to create preview webpage on your site. For example your site domain is www.mockfirebase.com

You should prepare link with your extra data such as id=1234. ( https://www.mockfirebase.com/?id=1234 )

When clicked above link in phone, the preview web page will open. And you should check this app is installed in phone. To check/determine this app installed, you should use URL Schema technic. Learn URL Schema

if this app installed, url schema will open app. otherwise you should open appstore. Also you should save vendorID to identify which app redirect to appStore(to retrive your data id=1234).

After iOS 14.5, vendorID will not accessible as a public. You should ask to user to get this id.

As a result, I try to explain firebase workflow step by step.

It's been quite a while, but here I bring a solution that doesn't depend on AppsFlyer, Firebase Onelink or any other external SDK.

Nowadays it is quite common for app's to save certain information to the clipboard that is shared with the app once it is installed.

The process would be the following:,

  1. The user clicks on a link from a website, and automatically javascript copies the necessary information to the clipboard, for example: "data: 1234" and then redirects the user to the AppStore

  2. The user installs the app

  3. When the app opens for first time, the app pastes itself the information from the clipboard and searches for the data

You can check this behavior in the "Monday" app, for example, to automatically log in the user once the app has been downloaded.

You need to keep in mind, that from IOS14, a message alerting the user will be displayed in a toast over the app "Clipboard copied by Safari".

Also it is important to notice that, in order to avoid being rejected from Apple Store, you need to explicit inform the user before redirecting him to the download link.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM