Giter VIP home page Giter VIP logo

rewardzredemption-android's Introduction

RewardzRedemption-Android

This is the framework to list different type of rewards and provide functionality to redeem those rewards.

Framework is made by Rewardz developer team.

Requirements

Rewardz Redemption Library can be included in any Android application.

Rewardz Redemption Library supports Android 2.3 (Gingerbread) and later.

Using Rewardz Redemption Library in your application

Step 1.

Add the JitPack repository to your build file

allprojects { repositories { ... maven { url 'https://jitpack.io' } } }

Step 2.

Add this in your build.gradle

compile 'com.github.rewardz:RewardzRedemption-Android:0.1.3'

Step 3.

Sync gradle.

Step 4.

In your Activity/Fragment class implements RewardzRedemption.OnRewardsListListener, RewardzRedemption.OnRewardsRedeemed and override methods onRewardsListComplete() and onRewardsRedeemed().

Your class should look like below:

public class MainActivity extends AppCompatActivity implements RewardzRedemption.OnRewardsListListener, RewardzRedemption.OnRewardsRedeemed
{

  @Override
  public void onRewardsListComplete(String jsonResponse) {
      Log.v("Tag", "onRewardsListComplete ==> "+jsonResponse);
  }

  @Override
  public void onRewardsRedeemed(String jsonResponse) {
      Log.v("Tag", "onRewardsRedeemed ==> "+jsonResponse);
  }
}

Step 5.

Collect oAuth Token provided by our support team or from admin panel and put it in your source code.

 private final String oAuthToken = "Token <token_by_admin_panel>";

Step 6.

To Load rewards list in your app, you have to call:

 RewardzRedemption.getInstance(this, this, this).getRewardsList(oAuthToken);

This line will give you all rewards in JSON array format that you will get in below overrided method:

  @Override
        public void onRewardsListComplete(String jsonResponse) {
            Log.v("Tag", "onRewardsListComplete ==> "+jsonResponse);
        }

To Redeem perticular reward in your app, you have to call:

 RewardzRedemption.getInstance(this, this, this, this).redeemRewards(oAuthToken, paramMap);

This line will give you result in JSON format after redeeming any reward that you will get in below overrided method:

 @Override
      public void onRewardsRedeemed(String jsonResponse) {
          Log.v("Tag", "onRewardsRedeemed ==> "+jsonResponse);
      }

And, It's done. Voilla...!

Start creating your own UI as per your app design and load rewards list and give your app's user to redeem them whenever they want. Happy Coding.

Find this project useful ? ❤️

  • Support it by clicking the ⭐️ button on the upper right of this page. ✌️

Contact - Let's become friends

License

Copyright (C) 2016 Rewardz Pte Ltd
Copyright (C) 2011 Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Contributing to RewardzRedemption Framework

Just make pull request. You're in!

rewardzredemption-android's People

Contributors

manishandroid avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

showdpro

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.