This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Amazon
Roman Zhilich edited this page Apr 22, 2015
·
23 revisions
This BillingProvider
implementation adds support for Amazon Appstore.
###Dependency
Amazon billing provider depends on proprietary in-app-purchasing.jar
which can be found within Amazon Mobile App SDK.
You can download it yourself and manually add it to your project, or user our GitHub hosted repo instead.
- Add repository to your main
build.gradle
allprojects {
repositories {
...
// third-party dependencies
maven { url 'https://raw.githubusercontent.com/onepf/OPF-mvn-repo/master/' }
}
}
- Add dependencies
dependencies {
compile 'org.onepf:opfiab-amazon:0.2.0@aar'
compile 'com.amazon:in-app-purchasing:2.0.61'
}
Add following entries to your AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application>
<receiver
android:name="com.amazon.device.iap.ResponseReceiver"
android:exported="true">
<intent-filter>
<action
android:name="com.amazon.inapp.purchasing.NOTIFY"
android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY"/>
</intent-filter>
</receiver>
</application>
final AmazonBillingProvider amazon = new AmazonBillingProvider.Builder(context)
.setPurchaseVerifier(new MyAmazonPurchaseVerifier())
.setSkuResolver(new MyAmazonSkuResolver())
.build();
According to official documentation Amazon recommends using server-side purchase verification.
Unfortunately that means you'll have to make your own implementation of PurchaseVerifier
interface. Check out Implementing Billing Provider for more details.
todo
todo
todo
todo