Quick Start
Overall Process
iOS Integration
Step 1: Create an app
App ID Reference Document。
- App name: The name of your app
- Store: The platform that is divided into Android and iOS, and you should select iOS in this case.
- App Bundle ID: bundleID is the identifier of your app in the Apple App Store, which can be obtained by viewing your app in App Store Connect.
- iTunesConnect App Specific Shared Secret: The shared secret, which is needed to verify the order receipt generated by your app. For the acquisition method, please refer to: https://help.apple.com/app-store-connect/#/devf341c0f01. There are two shared keys: One is the shared key for all apps; the other is a shared key for a single app. A shared key for a single app is recommended.
Step 2: Configuration
Notification Receiving Configuration( Important: If you have your own receiving server, please refer to the "Configure Notification Receiving Server")
To send Apple server notifications to Appwheel, please configure the following address
to Apple Store Connect: (Currently supports V1 type notifications)
Configure Notification Receiving Server(optional)
▪ If you have your own notification receiving server that needs the push data, you can set the receiving server address in the AppWheel main site. We will send each message once in the order in which the messages arrive, but sometimes the messages may not be delivered in sequence, or will be transmitted multiple times. You should design the program in the way of idempotent processing.
▪ After the configuration is complete, you can test the availability of the address. The configuration must be consistent with the requirements, that is, accept the request of the POST method, return 200 Http status code after successful processing, and return 400 or 500 status code when processing fails. In addition, because there is no actual business data body in the test, the 200 http status code can be returned when empty data is received.
p8 file configuration for purchasing discounted products
When your app has a discount set in the Apple App Store, and you want to sync the information to AppWheel, you need to set the p8 file in AppWheel。
Service Account credentials File: A file with a .p8 suffix, commonly called a p8 file. When you need to enable the subscription discount function, you need to have a signature for the discount, and the p8 file is an essential key to generate this signature. Obtain it through: https://help.apple.com/app-store-connect/#/dev689c93225
Step 3: Setting up the Installation Environment
Requirements iOS 10.0 and above
CocoaPods
This SDK is hosted in Cocoapods. please make sure you have installed Cocoapods and your project has been compiled and run successfully with Cocoapods before installing this SDK. If your project has been compiled and run successfully with Cocoapods and you can find Podfile in your project.
Import Bridging-Header.h
If your project is a Swift project, then you need to import Objective-C into Swift. You can find the Bridging-Header.h file in your project after importing.
Step 4: Install the SDK
Step 5: Acceptance Inspection
- App Configuration Check
- Whether the notification is configured successfully: Check the configuration in the AppStoreConnect backend
- App configuration is as follows
- Whether the initialization interface is called at startup
- Whether the AppWheel SDK can get the information of purchased products
- Subscription Products
- Discount products (optional)
- Discount for new users
- Promotion offer
- Coupon
- Consumable products
- Non-consumable products
- Non-renewable products
- Whether the AppWheel SDK can restore product information
Android Integration
Step 1: Create an app
App ID reference Document。
- App name: The name of your app
- Store: The platform that is divided into Android and iOS, and you should select Android in this case.
- Google Play package: The package name of your app, which is the unique identifier of your app in the Google Play Store and can be obtained in the Google Play Console
- Service Account credentials JSON: The json file required by the server to verify the order. Before you obtain this file, please confirm that you have completed the necessary configuration for Google payments, which is described in the Necessary Preparation for AppWheel (Android). When you have completed the configuration, you will have a json file. Please upload this file to our backend to create your Android app accordingly.
Step 2: Configuration
Notification Receiving Configuration ( Important: If you have your own receiving server, please refer to the "Configure Notification Receiving Server")
To send Google server notifications to AppWheel, please configure the address
To Google Cloud Platform,(ensure you can enable Google Cloud Pub/Sub)):
Configure Notification Receiving Server(optional)
▪ If you have your own notification receiving server that needs the push data, you can set the receiving server address in the AppWheel main site. We will send each message once in the order in which the messages arrive, but sometimes the messages may not be delivered in sequence, or will be transmitted multiple times. You should design the program in the way of idempotent processing.
▪ After the configuration is complete, you can test the availability of the address. The configuration must be consistent with the requirements, that is, accept the request of the POST method, return 200 Http status code after successful processing, and return 400 or 500 status code when processing fails. In addition, because there is no actual business data body in the test, the 200 http status code can be returned when empty data is received.
Product Configuration
- There's already a product configuration
- No product configuration
Step 3: Install the SDK
Step 4: Acceptance Inspection
- App Configuration Check
- To make sure a notification is configured successfully: Check if the Google Cloud Pub/Sub queue has notification settings
- The basic configuration is as follows
- Whether the initialization interface is called at startup
- Whether the AppWheel SDK can get the information of purchased products
- Subscription Products
- In-App Products
- Discount products (optional)
- Single Payment Products
- Recurring Payment Products
- Whether the AppWheel SDK can restore product information
Other steps: Integration of advanced features
- Java
- Kotlin
- Objective-C
- Swift
///Adding a listener
UserOrderManager.getProvider().addPurchaseObserver(new OrderObserver() {
@Override
public void onUpdateOrders(List<MTGPurchase> purchases) {
// Monitor order changes
}
});
///Remove listener
UserOrderManager.getProvider().removePurchaseObserver(orderObserver);
///Adding a listener
UserOrderManager.getProvider().addPurchaseObserver {
//Monitoring order changes
}
///Remove listener
UserOrderManager.getProvider().removePurchaseObserver(orderObserver)
///Adding a listener
[AWPurchaseKit addPurchaseObserver:AWPurchaseObserver];
///Remove listener
[AWPurchaseKit removePurchaseObserver:self]
///Adding a listener
AWPurchaseKit.add(AWPurchaseObserver)
///Remove listener
AWPurchaseKit.remove(AWPurchaseObserver)