Skip to content

Commit

Permalink
6.6.0
Browse files Browse the repository at this point in the history
6.6.0
  • Loading branch information
amit-kremer93 committed May 18, 2022
2 parents fc004ba + d7b8e5c commit 44e4209
Show file tree
Hide file tree
Showing 35 changed files with 565 additions and 34 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to deploy'
required: true
default: ''
type: choice
options:
- info
- warning
- debug

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- run: |
echo "The branch: $BRANCH"
env:
BRANCH: ${{ github.event.inputs.branch }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ local.properties
android/gradlew.bat
.vscode
android/gradle
android/.project

# node.js
#
Expand All @@ -58,3 +59,8 @@ demos/appsflyer-react-native-app/.DS_Store
demos/appsflyer-react-native-app/node_modules
demos/appsflyer-react-native-app/ios/Podfile.lock
demos/appsflyer-react-native-app/ios/Pods
demos/appsflyer-expo-app/ios
demos/appsflyer-expo-app/android
demos/appsflyer-expo-app/.expo
demos/appsflyer-expo-app/node_modules
demos/appsflyer-expo-app/yarn.lock
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 6.6.0
Release date: *2022-May-18*

- React Native > Expo
- React Native > Fix app crash when activity is null on sendPushNotificationData

## 6.5.21
Release date: *2022-February-16*

Expand Down
12 changes: 7 additions & 5 deletions Docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,16 @@ appsFlyer.updateServerUninstallToken('token', (res) => {

---

##### <a id="sendPushNotificationData"> **`sendPushNotificationData(pushPayload): void`**
Push-notification campaigns are used to create fast re-engagements with existing users.
AppsFlyer supplies an open-for-all solution, that enables measuring the success of push-notification campaigns, for both iOS and Android platforms.<br>
Learn more - https://support.appsflyer.com/hc/en-us/articles/207364076-Measuring-Push-Notification-Re-Engagement-Campaigns
##### <a id="sendPushNotificationData"> **`sendPushNotificationData(pushPayload, ErrorCB): void`**
Push-notification campaigns are used to create fast re-engagements with existing users.<br>
[Learn more](https://support.appsflyer.com/hc/en-us/articles/207364076-Measuring-Push-Notification-Re-Engagement-Campaigns)<br>
For Android platform, AppsFlyer SDK uses the activity in order to process the push payload. Make sure you call this api when the app's activity is available (NOT dead state).<br>
From version ***6.6.0*** we added an error callback that returns an error message.<br>

| parameter | type | description |
| ---------- |----------|------------------ |
| pushPayload | json | push notification payload |
| ErrorCB | function | returns an error msg when the payload has not been sent |


*Example:*
Expand All @@ -593,7 +595,7 @@ const pushPayload = {
sound:"default"
}
};
appsFlyer.sendPushNotificationData(pushPayload);
appsFlyer.sendPushNotificationData(pushPayload, err => console.log(err));
```

---
Expand Down
63 changes: 57 additions & 6 deletions Docs/DeepLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,31 @@ In your app’s manifest add the following intent-filter to your relevant activi
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="your unique scheme" />

<data
android:host="mainactivity"
android:scheme="afshopapp" />
</intent-filter>
```
For more on URI Scheme check out the guide [here](https://dev.appsflyer.com/hc/docs/initial-setup-for-deep-linking-and-deferred-deep-linking#deciding-on-a-uri-scheme).
#### <a id="app-links"> App Links
For more on App Links check out the guide [here](https://support.appsflyer.com/hc/en-us/articles/115005314223-Deep-Linking-Users-with-Android-App-Links#what-are-android-app-links).
First you need to generate SHA256 fingerprint an then In your app’s manifest add the following intent-filter to your relevant activity:
```xml
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="onelink-basic-app.onelink.me"
android:scheme="https" />
</intent-filter>
```
For more on App Links check out the guide [here](https://dev.appsflyer.com/hc/docs/initial-setup-for-deep-linking-and-deferred-deep-linking#procedures-for-android-app-links).
### <a id="ios-deeplink"> iOS Deeplink Setup
For more on Universal Links check out the guide [here](https://support.appsflyer.com/hc/en-us/articles/208874366-OneLink-Deep-Linking-Guide#setups-universal-links).
In order to record retargeting and use the onAppOpenAttribution/UDL callbacks in iOS, the developer needs to pass the User Activity / URL to our SDK, via the following methods in the **AppDelegate.m** file:
#### import
Expand All @@ -201,8 +215,9 @@ In order to record retargeting and use the onAppOpenAttribution/UDL callbacks in
return YES;
}
```
Essentially, the Universal Links method links between an iOS mobile app and an associate website/domain, such as AppsFlyer’s OneLink domain (xxx.onelink.me). To do so, it is required to:
#### Universal Links
Universal Links link between an iOS mobile app and an associate website/domain, such as AppsFlyer’s OneLink domain (xxx.onelink.me). To do so, it is required to:
1. Configure OneLink sub-domain and link to mobile app (by hosting the ‘apple-app-site-association’ file - AppsFlyer takes care of this part in the onelink setup on your dashboard)
2. Configure the mobile app to register approved domains:
Expand All @@ -219,3 +234,39 @@ Essentially, the Universal Links method links between an iOS mobile app and an a
</dict>
</plist>
```
For more on Universal Links check out the guide [here](https://dev.appsflyer.com/hc/docs/initial-setup-2#getting-the-app-bundle-id-and-prefix-id).
#### URI Scheme
A URI scheme is a URL that leads users directly to the mobile app.
When an app user enters a URI scheme in a browser address bar box, or clicks on a link based on a URI scheme, the app launches and the user is deep-linked.
To configure it you will have to:
1. Add a unique url identifier in the URL types entry in the app's `info.plist`
2. Add URL Scheme as a value.
example of a URL scheme configuration in the `info.plist`:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
...
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>YOUR.URL.IDENTIFIER</string>
<key>CFBundleURLSchemes</key>
<array>
<string>YOUR-URL-SCHEME</string>
</array>
</dict>
</array>
...
</dict>
</plist>
```
For more on URI Scheme check out the guide [here](https://dev.appsflyer.com/hc/docs/initial-setup-2#procedures-for-uri-scheme).
105 changes: 105 additions & 0 deletions Docs/Expo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# 🚀 Integrate AppsFlyer into an Expo managed project (Beta)
1. Install `expo-dev-client`:
```
expo install expo-dev-clients
```
2. Install react-native-appsflyer:
```
expo install react-native-appsflyer
```
3. Add `react-native-appsflyer` into the `plugins` array inside the `app.json` file of your app:
```
...
"plugins": [
[
"react-native-appsflyer",{}
]
],
...
```
If you are developing a kids app and you wish to use our strict mode, you should add `"shouldUseStrictMode": true` as followed:
```
...
"plugins": [
[
"react-native-appsflyer",{"shouldUseStrictMode": true}
]
],
...
```
4. In order to use AppsFlyer's deeplinks you need to configure intent filters/scheme/associatedDomains as described in [Expo's guide](https://docs.expo.dev/guides/linking/#universal-links-on-ios).

### Full app.json example
```
{
"expo": {
"name": "expoAppsFlyer",
"slug": "expoAppsFlyer",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/atom.png",
"plugins": [
[
"react-native-appsflyer",
{"shouldUseStrictMode": true} // <<-- for strict mode
]
],
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"scheme": "my-own-scheme", // <<-- uri scheme as configured on AF dashboard
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.appsflyer.expoaftest",
"associatedDomains": ["applinks:expotest.onelink.me"] // <<-- important in order to use universal links
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
},
"package": "com.af.expotest",
"intentFilters": [
{
"action": "VIEW",
"data": [
{
"scheme": "https",
"host": "expotest.onelink.me",
"pathPrefix": "/DvWi"
}
],
"category": [
"BROWSABLE",
"DEFAULT"
]
},
{
"action": "VIEW",
"data": [
{
"scheme": "my-own-scheme" // <<-- uri scheme as configured on AF dashboard
}
],
"category": [
"BROWSABLE",
"DEFAULT"
]
}
]
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
```
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

### <a id="plugin-build-for"> This plugin is built for

- Android AppsFlyer SDK **v6.5.2**
- iOS AppsFlyer SDK **v6.5.2**
- Android AppsFlyer SDK **v6.6.1**
- iOS AppsFlyer SDK **v6.6.1**

## <a id="breaking-changes"> ❗❗ Breaking changes when updating to v6.x.x❗❗

Expand Down Expand Up @@ -45,11 +45,12 @@ If you have used 1 of the removed APIs, please check the integration guide for t

## 📖 Guides
- [Adding the SDK to your project](/Docs/Installation.md)
- [Integrate into an ***Expo*** project](/Docs/Expo.md)
- [Initializing the SDK](/Docs/BasicIntegration.md)
- [In-app Events](/Docs/InAppEvents.md)
- [Deep Linking](/Docs/DeepLink.md)
- [Advanced APIs](/Docs/AdvancedAPI.md)
- [Testing the integration](/Docs/Testing.md)
- [APIs](/Docs/API.md)
- [React-Native Sample App](/demos/appsflyer-react-native-app)
- [React-Native Sample App](/demos)

11 changes: 11 additions & 0 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,21 @@ describe("Test appsFlyer API's", () => {
appsFlyer.stop(true);
expect(RNAppsFlyer.stop).toHaveBeenCalledTimes(1);
});

test('it calls appsFlyer.stop(true, cb)', () => {
appsFlyer.stop(true, jest.fn);
expect(RNAppsFlyer.stop).toHaveBeenCalledTimes(1);
});

test('it calls appsFlyer.sendPushNotificationData({}, errorCb)', () => {
appsFlyer.sendPushNotificationData({ foo: 'bar' }, jest.fn);
expect(RNAppsFlyer.sendPushNotificationData).toHaveBeenCalledTimes(1);
});

test('it calls appsFlyer.sendPushNotificationData({})', () => {
appsFlyer.sendPushNotificationData({ foo: 'bar' });
expect(RNAppsFlyer.sendPushNotificationData).toHaveBeenCalledTimes(1);
});
});

describe('Test native event emitter', () => {
Expand Down
1 change: 1 addition & 0 deletions __tests__/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jest.mock('../node_modules/react-native/Libraries/BatchedBridge/NativeModules',
setPartnerData: jest.fn(),
setSharingFilterForPartners: jest.fn(),
setCurrentDeviceLanguage: jest.fn(),
sendPushNotificationData: jest.fn(),
},
};
});
Expand Down
17 changes: 17 additions & 0 deletions android/.project
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,30 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1643112709182</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ repositories {
dependencies {
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
implementation "com.android.installreferrer:installreferrer:${safeExtGet('installReferrerVersion', '2.1')}"
implementation "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '6.5.2')}"
implementation "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '6.6.1')}"
}
Loading

0 comments on commit 44e4209

Please sign in to comment.