Thứ Năm, 15 tháng 11, 2012
1. Introduction
To integrate our SDK as a publisher for Metaps, there are multiple ways to both display and
receive confirmation for Offers on the ad network. Before implementation, please consider
which method you will use to integrate, and choose the method that best matches your app.
How to use the Metaps Offerwall
The method available to display Offers depends on the type of app, as illustrated in the
diagram below.
How to receive Reward Confirmation
There are two ways to be notified of confirmation that the end-user can receive their reward
and publisher is entitled to a reward payout (Reward Confirmation). You can choose to
receive the confirmation from within the app, or have a notification sent to the server of your
choosing.
The meanings of the values above are as follows:
net.metaps.sdk.CLIENT_ID: Metaps ID
An unique identification assigned to advertisers and media. This can be confirmed at the
Login screen.
net.metaps.sdk.APP_ID: App ID
An unique identification assigned by metaps to each registered app. This can be
confirmed at the Login screen.
net.metaps.sdk.APP_KEY: Authentication key
An unique identification assigned by metaps for authentication purposes. This can
be confirmed at the Login screen.
net.metaps.sdk.PROMOTION_ID: Promotion ID
A string (up to 16 characters) that can be used for identifying your promotion
campaign.
net.metaps.sdk.MARKET: Market
A string (up to 16 character) that can be used to identify your intended market.
net.metaps.sdk.MODE: Test/Release Indication
1=Test/Debug, 0=Release
Add Resource Files to Project
Inside the downloaded SDK zip file, there is a folder named "res". This folder contains the
layout files necessary for your project to display the Offerwall correctly. Copy all these files
into your project, taking care not to overwrite any existing resources that you may have
already created, such as strings.xml.
If you already have an existing strings.xml, you should append the string resources
required by the SDK to your existing strings.xml.
Each file in the “res” folder is explained below. You can freely customize the design of the
layouts by editing or replacing files, as long as the names of the files/layouts remain the
same.
To ensure these layouts work properly, a specified ID must be used. Details regarding
these IDs are explained later in this documentation. If any of the IDs are missing, your app
may not work properly, so please pay close attention when customizing.
Important: Be careful not to overwrite your existing strings.xml, or forget to
append the Metaps SDK strings to your existing file.
It is possible to overwrite the “app_name” value as set in strings.xml to whatever
you want or use.
If you require other languages than English / Japanese / Chinese, it is possible to
create respective resource folders to support that language. If creating these folders,
please adhere to the Android standard naming conventions.
Settings for the Publisher
It is necessary to fill in the following publisher app settings from the Metaps dashboard.
After you login to the dashboard, select “Developer” “Monetize” then click on the “Edit”
button under “Reward Edit” for the registered app.
The fields that can be edited are listed below.
Title This string is shown at the top of the Offerwall. You can
set this as your app name or whatever you wish.
User-reward Unit in your App The virtual currency unit that you use inside the app.
User-reward Amount The conversion rate used to reward users points. You
will need to put in a value for the amount of virtual currency
to reward for every 100 points received from an offer.
e.g. if you input “20” here and your virtual currency unit is
“stars”, if you receive 100 points from the offer, the user
will receive 20 stars.
Reward Confirmation Metaps Server: Select this if you will receive Reward
Confirmation inside the app.
Notify Your Server: Select this is if Reward Confirmation
is to be sent to your server first.
Use SDK Decline fulfillment notification via the use of html tag
or SDK: Unused option.
Will notify Metaps of fulfillment via the use of html tag
or SDK: Please select this option.
Reward Confirmation URL If you have selected “Notify Your Server” in the Reward
Confirmation setting above, you will need to input your
server URL here to be notified of Reward Confirmation.
5. Displaying Offers with the SDK
Initialize the SDK Inside your Project
Note: This section on initialization is not required for developers using WebView, and
can skip to the next section on “Displaying Offers Using WebView"
Before using the SDK to display the Offerwall, you must first call the static method
startReward of the MetapsFactory class.
It is essential that the startReward method be called before any other processes are
executed. Therefore it is recommended that you call startReward in your Activity’s
onResume method.
About “Receiver”
The "Receiver" that appears in the sample code above assumes that you will implement the
net.Metaps.sdk.Receiver interface as "MyReceiver" (or whatever class name you want).
Inside "MyReceiver", you will need to create the Java code that processes the received
points from Metaps, and give virtual currency or unlock rewards for the end-user.14
For further details, look at the section, "Receiving Reward Confirmation" under the chapter
"Receiving Reward Confirmation in Your App".
About the parameters for the startReward method
Inside the SDK zip file you will find a JavaDoc under the “doc” folder. For more details on
the parameters, please refer to the JavaDoc.
About “end-user ID”
For the end-user ID, please pass a unique ASCII string, no longer than 32 characters in
length to identify each end-user in your application. If the notification for Reward
Confirmation is to be sent to your server, it is required to pass this end-user ID string at
some point. (i.e. at initialization or before displaying the Offerwall)
It is possible to perform initialization while passing an empty string or null value, but be sure
to pass a valid value by the time your display the Offerwall.
About “scenario”
The scenario string is an ASCII string with a maximum length of 64 characters. Depending
on your app’s calling activity, this can be used to branch out the process for receiving
Reward Confirmation.
It is possible to perform initialization while passing an empty string or null value at this point.
Displaying the Offerwall from a Native App
The ways in which to show Reward Ads are highly customizable, and can be tailored to
meet the needs of your app. Although the Offerwall can be called in different ways, the
sample code below illustrates one of the simpler ways this can be done.
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét