Goaffpro client for react native apps
npm install react-native-goaffproReact native module to implement goaffpro affiliate marketing system in react native apps
``sh`
npm install react-native-goaffpro
`js
import { init, trackPageView, trackConversion } from 'react-native-goaffpro';
// ...
// use your public token from Settings -> Advanced Settings tab -> Access Tokens section
// to initialize the SDK
init('x-goaffpro-public-token');
trackPageView(); // optional method to call on screen change. To increment the page view counter for the affiliates
// after the customer places the order, call the following to track the conversion
trackConversion({
number: '#1001',
total: 500,
});
// for complete order schema of trackConversion method, see
// https://github.com/anujtenani/goaffpro/wiki/Custom-Integration-advanced-guide#extended-order-schema-for-conversion-tracking
`
`js
import { getAffiliateDetails } from 'react-native-goaffpro';
// returns details about the current affiliate
getAffiliateDetails().then((data) => {
console.log(data);
// here data object's shape is
// {
// "name":"John Doe",
// "firstName":"John",
// "lastName":"Doe"
// "coupon":"COUPONCODE",
// }
});
`
https://github.com/anujtenani/react-native-goaffpro-sample-app
To enable deep links in your android app, you can follow the guide below
https://developer.android.com/training/app-links/deep-linking#adding-filters
In your AndroidManifest.xml file, for you main activity, set the intent filter to open the app
`xml``
android:label="@string/title_gizmos" >
Note: You will also need to host a assetlinks.json file on your website to verify the identity
https://developer.android.com/training/app-links/verify-site-associations#web-assoc
You can follow the guides below
https://reactnative.dev/docs/linking#built-in-url-schemes
https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html