Search code examples
androidandroid-studioinvitereferrals

Integrate InviteReferrals program in Android app


I am new to this InviteReferrals program and I have no much information about how it works. I read the official documentation of InviteReferrals program and tried to integrate its SDK in Android app but I am getting below error message:

invitereferrals invite: Campaign rule not available

I tried to search the issue on SO but didn't find anything for this issue.

As the official document said, I added the below code in manifest file:

<meta-data
            android:name="invitereferrals_bid"
            android:value="xxxxx" /> 

        <meta-data
            android:name="invitereferrals_bid_e"
            android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />

xxxxx values are my actual values.

Also, I initialized its SDK correctly using below line of code:

// Initialize InviteReferral SDK
        InviteReferralsApi.getInstance(this).initialize(this.getIntent().getData());

When to send invite to user, I used the below line of code:

InviteReferralsApi.getInstance(this).inline_btn(1);
InviteReferralsApi.getInstance(this).invite("rule1");

But I see no referral dialog/message but I get the above mentioned error message in logs.

If anyone has integrated this referral program then kindly let me know when I am doing wrong or what to do to make it work in Android.


Solution

  • You need not to call invite("rule1") method for that. Call only:-

    InviteReferralsApi.getInstance(this).inline_btn(CAMPAIGN_ID);

    where CAMPAIGN_ID is your campaign id that you have created in the InviteReferrals dashboard.

    You can submit your query on Support Ticket on InviteReferrals official site for better and faster replies.