Skip to content

Commit fda99b0

Browse files
authored
Update README.md (#783)
adds documentation clarifying additional iOS setup for deep link tracking.
1 parent f3d5bc0 commit fda99b0

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

packages/plugins/plugin-appsflyer/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@ const plugin = new AppsflyerPlugin();
4141
segmentClient.add({ plugin });
4242
```
4343

44+
### Tracking Deep Links on iOS
45+
46+
The Analytics React Native SDK [requires additonal setup](https://github.com/segmentio/analytics-react-native#ios-deep-link-tracking-setup) to automatically track deep links. If you are also tracking [Universal Links](https://dev.appsflyer.com/hc/docs/ios-sdk-reference-appsflyerlib#continue), add the following to your `AppDelegate.m` :
47+
48+
```objc
49+
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
50+
restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
51+
{
52+
if ([userActivity.activityType isEqualToString: NSUserActivityTypeBrowsingWeb]) {
53+
NSURL *url = userActivity.webpageURL;
54+
NSDictionary *options = @{};
55+
[AnalyticsReactNative trackDeepLink:url withOptions:options];
56+
}
57+
```
58+
4459
## Support
4560
4661
Please use Github issues, Pull Requests, or feel free to reach out to our [support team](https://segment.com/help/).
@@ -72,4 +87,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
7287
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
7388
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
7489
SOFTWARE.
75-
```
90+
```

0 commit comments

Comments
 (0)