Xamarin SDK
Integration for Xamarin Android SDK
Download Xamarin Android SDK
You can contact us on [email protected] if any assistance is required.
SDK source can be downloaded from here.
1. Integrate the SDK
1.1 - Extract the invitereferrals.zip file ,open invitereferrals/dll folder copyInvitereferrals.dll add it as a reference to your app.
1.2 - Copy invitereferrals/assets/fonts.ttf file into YourApplication/Assets folder.
1.3 - Copy all icons from invitereferrals/drawables folder into YourApplication/Resources/drawables folder.
1.4 - Copy all icons from invitereferrals/anim folder into YourApplication/Resources/anim folder.
1.5 - Copy invitereferrals/values/Strings.xml file into YourApplication/Resources/values folder.
1.6 - If your app doesn't have android.support.v4 reference, then add reference for android.support.v4 to it.
2. Configure your AndroidManifest.xmlx
<manifest....>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<aplication....>
<activity android:name=".CampaignLogin"></activity>
<activity android:name=".ShareScreen"></activity>
<receiver
android:name="com.invitereferrals.invitereferrals.InviteReferrerBroadcastReceiver"
android:exported="true"
android:enabled="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<meta-data android:name="invitereferrals_bid" android:value="29XX8"></meta-data>
<meta-data android:name="invitereferrals_bid_e"
android:value="DD85448BF2XXXX482D5F8C28425AAC6F" ></meta-data>
</application></manifest>
3. Initializing the sdk
a) If you don’t have your own application class, then in the manifest file register our application class like this in application tag:
<aplication android:name="com.invitereferrals.invitereferrals.InviteReferralsApplication"></application>
b) If you have your own application class then inside your application class onCreate method, call our register method like this:
InviteReferralsApplication.Register(this);
4. Add Referral Button
Add the following line in your custom button click. Replace CampaignID with the id of the referral campaign. Default campaignID will be applied if no campaignID specified.
InviteReferralsApi.GetInstance(this).Inline_btn((int)CampaignID);
Example:
InviteReferralsApi.GetInstance(this).Inline_btn(1765);
For Default Campaign you can pass 0 as CampaignID:
InviteReferralsApi.GetInstance(this).Inline_btn(0);
5. Show Refer a friend Popup
Just add the following line in the activity in which you want to show the referral program popup.
InviteReferralsApi.GetInstance(this).Invite((String)CUSTOM_RULE);
InviteReferralsApi.GetInstance(this).Invite("home");
You may then set rules in the inviteReferrals campaign settings to show campaign popup after specific time delay or after specific number of App launches on this view.
6. Pass User Details for Auto-Login (Single Sign In)
InviteReferralsApi.GetInstance(this).UserDetails((String)name, (String)email, (String)mobile, 0, (String)subscriptionID, (String)customValues);
Example:
InviteReferralsApi.GetInstance(this).UserDetails('Tom', '[email protected]', '9812546723', 0, null, null);
7. Track Install / Register / Sale Events
This is how you call tracking() method to track:
Install
InviteReferralsApi.GetInstance(this).Tracking("install", null, 0);
Register
InviteReferralsApi.GetInstance(this).Tracking("register", (String)EMAIL_ID, 0);
Sale
InviteReferralsApi.GetInstance(this).Tracking("sale", (String)ORDER_ID, (int)PURCHASE_VALUE);
8. Show Welcome Message
Show welcome message to the customer if he comes through the referral of his friend.
InviteReferralsApi.GetInstance(this).ShowWelcomeMessage();
Updated over 3 years ago