Skip to content

Commit bff5eaf

Browse files
authored
Update README.md
1 parent 73b5168 commit bff5eaf

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ This is NOT a TROPHiT SDK - this repo is an open-source contribution to develope
99
* Tested with [Adjust Unity SDK](https://github.com/adjust/unity_sdk) v4.10.0
1010
* Also enables Adjust's SDK to handle iOS Universal Links
1111
* Assuming you already integrated the Adjust SDK, just implement `onDeeplink` in *UnityDeeplinks.cs* as follows:
12-
```
12+
```cs
1313
public void onDeeplink(string deeplink) {
1414
AdjustEvent adjustEvent = new AdjustEvent("abc123");
1515
adjustEvent.addCallbackParameter("deeplink", deeplink); // optional, for callback support
1616
Adjust.trackEvent(adjustEvent);
1717
}
1818
```
1919
* Add the following code marked `add this` to *Assets/UnitDeeplinks/iOS/UnityDeeplinks.mm*:
20-
```
20+
```objc
2121
#import "Adjust.h" // <==== add this
2222
...
2323

@@ -34,7 +34,7 @@ public void onDeeplink(string deeplink) {
3434
* Tested with [Tune Unity Plugin](https://developers.tune.com/sdk/unity-quick-start/) v4.3.1
3535
* Also enables Tune's Plugin to handle iOS Universal Links
3636
* Assuming you already integrated the Tune Plugin, just implement `onDeeplink` in *UnityDeeplinks.cs* as follows:
37-
```
37+
```cs
3838
public void onDeeplink(string deeplink) {
3939
TuneEvent event = new TuneEvent("deeplink");
4040
event.attribute1 = deeplink;
@@ -45,7 +45,7 @@ public void onDeeplink(string deeplink) {
4545
#### Example: Track Deeplinks with Kochava
4646
* Also enables Kochava's SDK to handle iOS Universal Links
4747
* Assuming you already integrated the [Kochava Unity SDK](http://support.kochava.com/sdk-integration/unity-sdk-integration), just implement `onDeeplink` in *UnityDeeplinks.cs* as follows:
48-
```
48+
```cs
4949
public void onDeeplink(string deeplink) {
5050
Kochava.DeeplinkEvent(deeplink, null);
5151
}
@@ -55,7 +55,7 @@ public void onDeeplink(string deeplink) {
5555
* Tested with [AppsFlyer Unity SDK](https://support.appsflyer.com/hc/en-us/articles/213766183-Unity) v4.10.1
5656
* Also enables AppsFlyer's SDK to handle iOS Universal Links
5757
* Assuming you already integrated the [AppsFlyer Unity SDK](https://support.appsflyer.com/hc/en-us/articles/213766183-Unity), just implement `onAppOpenAttribution` in *AppsFlyerTrackerCallbacks.cs* as follows:
58-
```
58+
```cs
5959
public void onAppOpenAttribution(string validateResult) {
6060
print("AppsFlyerTrackerCallbacks:: got onAppOpenAttribution = " + validateResult);
6161
System.Collections.Generic.Dictionary<string, string> values =
@@ -79,15 +79,15 @@ In this approach, you use a subclass of the default *UnityPlayerActivity*, which
7979

8080
* Replace the default UnityPlayerActivity in your Assets/Plugins/Android/AndroidManifest.xml with com.trophit.MyUnityPlayerActivity:
8181

82-
```
82+
```xml
8383
<!--
8484
<activity android:name="com.unity3d.player.UnityPlayerActivity" ...
8585
-->
8686
<activity android:name="com.trophit.MyUnityPlayerActivity" ...
8787
```
8888

8989
* Add the following inside the <activity> tag, assuming your deeplink URL scheme is myapp://
90-
```
90+
```xml
9191
<intent-filter>
9292
<action android:name="android.intent.action.VIEW" />
9393
<category android:name="android.intent.category.DEFAULT" />
@@ -102,7 +102,7 @@ In this approach, you use a subclass of the default *UnityPlayerActivity*, which
102102
In this approach, a second activity with deeplink-handling code is added to the Unity project, without subclassing the default activity. Use this is case where option #1 is not acceptable (code is too complex, not under your control, cannot be subclassed, etc)
103103

104104
* Add the following activity to your Assets/Plugins/Android/AndroidManifest.xml, assuming your deeplink URL scheme is myapp://
105-
```
105+
```xml
106106
<activity android:name="com.trophit.DeeplinkActivity" android:exported="true">
107107
<intent-filter>
108108
<action android:name="android.intent.action.VIEW" />
@@ -150,7 +150,7 @@ This creates/updates a *UnityDeeplinks.jar* file under your Unity project's Asse
150150
UnityDeeplinks implements a native plugin for iOS, initialized by *Assets/UnityDeeplinks/UnityDeeplinks.cs*. the plugin listens for URL/Univeral Link activations and relayes them to the Unity script for processing.
151151

152152
* Ensure your XCode project's Info.plist file contains a custom URL scheme definiton or [Universal Links setup](https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html). Here is an example of a custom URL scheme *myapp://* for the bundle ID *com.mycompany.myapp*:
153-
```
153+
```xml
154154
<key>CFBundleURLTypes</key>
155155
<array>
156156
<dict>
@@ -168,7 +168,7 @@ UnityDeeplinks implements a native plugin for iOS, initialized by *Assets/UnityD
168168
## Testing
169169

170170
* Prepare a dummy web page that is accessible by your mobile device:
171-
```
171+
```xml
172172
<body>
173173
<a href="myapp://?a=b">deeplink test</a>
174174
</body>
@@ -188,14 +188,14 @@ Fortunately, AppsFlyer provides an implementation similar to [Alternative #2](#a
188188
* First, ensure you have the [AppsFlyer Unity SDK](https://support.appsflyer.com/hc/en-us/articles/213766183-Unity) integrated including the deeplinking configuration
189189
* Ensure you have your URL schemes or Universal Links set up
190190
* Next, ensure you call `AppsFlyer.getConversionData();` in your AppsFlyer iOS startup script, right after `setAppId`:
191-
```
191+
```cs
192192
#if UNITY_IOS
193193
AppsFlyer.setAppID ("123456789");
194194
AppsFlyer.getConversionData();
195195
// ...
196196
```
197197
* Add the following to *Assets/Plugins/Android/src/GetDeepLinkingActivity.java* inside `onCreate` right after `this.starActivity(newIntent)` and right before `finish`:
198-
```
198+
```java
199199
// this.startActivity(newIntent);
200200
String deeplink = getIntent().getDataString();
201201
if (deeplink != null) {

0 commit comments

Comments
 (0)