gomarketme-react-native 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -43
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<img src="https://static.gomarketme.net/assets/gmm-icon.png" alt="GoMarketMe" />
|
|
3
3
|
<br />
|
|
4
4
|
<h1>GoMarketMe React Native SDK</h1>
|
|
5
|
-
<p>Affiliate marketing for React Native apps on iOS and Android.</p>
|
|
5
|
+
<p>Affiliate marketing for React Native and Expo apps on iOS and Android.</p>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
@@ -10,21 +10,22 @@
|
|
|
10
10
|
### npm
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npm install gomarketme-react-native@5.0.
|
|
13
|
+
npm install gomarketme-react-native@5.0.1
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
### Yarn
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
yarn add gomarketme-react-native@5.0.
|
|
19
|
+
yarn add gomarketme-react-native@5.0.1
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
### pnpm
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
pnpm add gomarketme-react-native@5.0.
|
|
25
|
+
pnpm add gomarketme-react-native@5.0.1
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
|
|
28
29
|
## Usage
|
|
29
30
|
|
|
30
31
|
GoMarketMe takes only a few lines to set up.
|
|
@@ -48,46 +49,11 @@ useEffect(() => {
|
|
|
48
49
|
|
|
49
50
|
Replace `API_KEY` with your actual GoMarketMe API key. You can find it on the product onboarding page and under **Profile > API Key**.
|
|
50
51
|
|
|
51
|
-
### Step
|
|
52
|
+
### Alternative Step 1/3: Programmatic Affiliate Marketing
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
For apps that want to customize the user experience based on affiliate attribution, initialize GoMarketMe and read affiliate marketing data after initialization.
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
await GoMarketMe.syncAllTransactions();
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
If your purchase library lets you decide when to finish, acknowledge, consume, or complete the transaction, call `syncAllTransactions()` first.
|
|
60
|
-
|
|
61
|
-
```tsx
|
|
62
|
-
purchaseUpdateSub = purchaseUpdatedListener(async purchase => {
|
|
63
|
-
await GoMarketMe.syncAllTransactions();
|
|
64
|
-
|
|
65
|
-
await finishTransaction({ purchase, isConsumable: true });
|
|
66
|
-
});
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Step 3/3: iOS consumables only
|
|
70
|
-
|
|
71
|
-
If your iOS app sells consumable in-app purchases, add this key to your app's `Info.plist`:
|
|
72
|
-
|
|
73
|
-
```xml
|
|
74
|
-
<key>SKIncludeConsumableInAppPurchaseHistory</key>
|
|
75
|
-
<true/>
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
That's it. GoMarketMe automatically attributes and reports affiliate sales.
|
|
79
|
-
|
|
80
|
-
## Alternative Step 1: Advanced integration
|
|
81
|
-
|
|
82
|
-
For advanced use cases, you can also read GoMarketMe affiliate marketing data after initialization. This is useful for Programmatic Affiliate Marketing, such as affiliate-aware paywalls, personalized onboarding, promotions, or custom in-app experiences.
|
|
83
|
-
|
|
84
|
-
Common use cases include:
|
|
85
|
-
|
|
86
|
-
- Affiliate-aware paywalls and promotions.
|
|
87
|
-
- Personalized onboarding.
|
|
88
|
-
- Automatically connecting new users with the influencer who referred them.
|
|
89
|
-
|
|
90
|
-
Learn more about [Programmatic Affiliate Marketing](https://gomarketme.co/programmatic-affiliate-marketing/).
|
|
56
|
+
This enables [Programmatic Affiliate Marketing](https://gomarketme.co/programmatic-affiliate-marketing/), including affiliate-aware paywalls, personalized onboarding, promotions, and custom in-app experiences.
|
|
91
57
|
|
|
92
58
|
```tsx
|
|
93
59
|
import { useEffect, useState } from 'react';
|
|
@@ -125,10 +91,62 @@ useEffect(() => {
|
|
|
125
91
|
}, []);
|
|
126
92
|
```
|
|
127
93
|
|
|
128
|
-
|
|
94
|
+
### Step 2/3: Sync after purchase
|
|
95
|
+
|
|
96
|
+
After your app completes a purchase through `react-native-iap`, `expo-iap`, RevenueCat, Adapty, or another in-app purchase provider, call:
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
await GoMarketMe.syncAllTransactions();
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If your purchase library lets you decide when to finish, acknowledge, consume, or complete the transaction, call `syncAllTransactions()` first.
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
purchaseUpdateSub = purchaseUpdatedListener(async purchase => {
|
|
106
|
+
await GoMarketMe.syncAllTransactions();
|
|
107
|
+
|
|
108
|
+
await finishTransaction({ purchase, isConsumable: true });
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Step 3/3: iOS consumables only
|
|
113
|
+
|
|
114
|
+
If your iOS app sells consumable in-app purchases, add this key to your app's `Info.plist`:
|
|
115
|
+
|
|
116
|
+
```xml
|
|
117
|
+
<key>SKIncludeConsumableInAppPurchaseHistory</key>
|
|
118
|
+
<true/>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
That's it. GoMarketMe automatically attributes and reports affiliate sales.
|
|
122
|
+
|
|
123
|
+
## Platform Support
|
|
124
|
+
|
|
125
|
+
| Platform | Support | Notes |
|
|
126
|
+
| ----------------- | ------- | --------------------------------------- |
|
|
127
|
+
| iOS | ✅ | StoreKit 2, requires iOS 15+ |
|
|
128
|
+
| Android | ✅ | Google Play Billing v8.0.0+ |
|
|
129
|
+
| Expo Go | ❌ | Not supported |
|
|
130
|
+
| Expo Dev Client | ✅ | Full support |
|
|
131
|
+
| Bare React Native | ✅ | Full support |
|
|
132
|
+
|
|
133
|
+
## IAP Provider Compatibility
|
|
134
|
+
|
|
135
|
+
| Provider | Support | Notes |
|
|
136
|
+
|---|---:|---|
|
|
137
|
+
| react-native-iap | ✅ | Full support |
|
|
138
|
+
| expo-iap | ✅ | Full support |
|
|
139
|
+
| RevenueCat | ✅ | Supports Apple and Google IAPs |
|
|
140
|
+
| Adapty | ✅ | Supports Apple and Google IAPs |
|
|
141
|
+
|
|
142
|
+
GoMarketMe works alongside `react-native-iap`, `expo-iap`, RevenueCat, Adapty, and other IAP providers.
|
|
143
|
+
|
|
144
|
+
## Sample app
|
|
129
145
|
|
|
130
146
|
Check out the sample React Native app:
|
|
131
147
|
|
|
132
148
|
[https://github.com/GoMarketMe/gomarketme-react-native-sample-app](https://github.com/GoMarketMe/gomarketme-react-native-sample-app)
|
|
133
149
|
|
|
150
|
+
## Support
|
|
151
|
+
|
|
134
152
|
For integration support, contact [integrations@gomarketme.co](mailto:integrations@gomarketme.co) or visit [https://gomarketme.co](https://gomarketme.co).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gomarketme-react-native",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Affiliate Marketing for React Native and Expo iOS and Android apps.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -33,14 +33,23 @@
|
|
|
33
33
|
"keywords": [
|
|
34
34
|
"react-native",
|
|
35
35
|
"expo",
|
|
36
|
+
"expo-dev-client",
|
|
36
37
|
"affiliate-marketing",
|
|
37
38
|
"influencer-marketing",
|
|
38
39
|
"in-app-purchases",
|
|
39
40
|
"subscriptions",
|
|
41
|
+
"iap",
|
|
42
|
+
"react-native-iap",
|
|
43
|
+
"expo-iap",
|
|
44
|
+
"revenuecat",
|
|
45
|
+
"adapty",
|
|
46
|
+
"storekit",
|
|
47
|
+
"storekit2",
|
|
48
|
+
"google-play-billing",
|
|
40
49
|
"gomarketme",
|
|
41
50
|
"sdk",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
51
|
+
"ios",
|
|
52
|
+
"android",
|
|
44
53
|
"mobile",
|
|
45
54
|
"monetization",
|
|
46
55
|
"influencers"
|