TOP > SPS feature
Table of Contents
- Overview
- Import SPS library
- Enable SPS feature
- Authentication
- Initialize SPS
- Show SPS Portal
- Claim Point Screen
- Theme Setting Screen
- Opt Out Mission Feature
- Geolocation
Mission SDK provides a new feature which integrate Super Point Screen (SPS) Ad.
The purpose is to allow end users to earn SPS points.
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/rakuten-ads/Rakuten-Reward-Native-iOS.git'
target '' do
pod 'RakutenRewardNativeSDK', '7.0.0'
end
Open your project's Cartfile and add Reward Native SDK dependency
binary "https://raw.githubusercontent.com/rakuten-ads/Rakuten-Reward-Native-iOS/master/CarthageSpec.json" == 7.0.0
Then run carthage update with XCFramework to download Reward Native SDK
carthage update --platform ios --use-xcframeworks
Open your app's project or workspace
Drag the binaries from Carthage/Build into the Frameworks, Libraries, and Embedded Content section of your target
In order to use the SPS feature in Mission SDK, please ask SPS BU to enable the feature for your application.
Due to Mission SDK and SPS have different system for authentication, so we can't share the same token among two SDKs.
Please follow the instruction below according to the authentication options the client app is using.
The client app need to include the following audience and scopes in the CAT configuration.
Audience | Scopes |
---|---|
rakuten_sp_scr_web |
|
Initialize SPS feature with the following API
RakutenMissionSps.shared.initSps(platform: String, sdkTokenProvider: () -> SdkTokenProvider)
RakutenMissionSps.shared.initSps(platform: "example") {
TokenProvider.shared
}
Please check with SPS team regarding the platform-name
.
SdkTokenProvider is a class from 'ScreenSDKCore'. Import 'ScreenSDKCore' framework to use
class TokenProviderExample: SdkTokenProvider {
static let shared = TokenProvider()
func getSpsCompatToken(completionHandler: @escaping (SpsCompatToken?, Error?) -> Void) {
completionHandler(SpsCompatToken.CatExchange(tokenValue: "exchangeToken"), nil) // pass your exchange token here
}
}
The following API will display SPS Portal as shown below.
RakutenReward.shared.openSpsPortal { result in
// handle callback
}
Screenshots of the SPS Portal
If the logged in user is not a SPS member, a member registration screen will be shown first.
Importing this SPS library will update the Claim Point screen as well.
Below is a screenshot of the new screen.
In the SPS Portal settings screen, users are able to set their desire theme.
Currently we support 2 themes:
Mission Theme |
---|
Panda |
Simple |
If your application also provide theme options and would like to sync the selected theme, you can implement the callback to SDK.
RakutenMissionSps.shared.didUpdateAppTheme = { theme in
// Check latest theme
}
You can call the following API to sync the theme setting from your application to Mission SDK.
// set to Okaimono Panda theme
RewardConfiguration.setTheme(.panda)
// or set to Simple theme
RewardConfiguration.setTheme(.simple)
If your application is not intended to use any mission features, use the following API to opt out of mission features.
// Set this to false to disable Mission feature if you want to use SPS feature only. The default value is true/enabled.
@objc public static var isMissionFeaturedEnabled = true
// Example
RewardConfiguration.isMissionFeaturedEnabled = true
In order to optimize the Ad delivery, you can provide end users' current location. (This is an optional API)
// provide the latitude and longitude
RakutenMissionSps.shared.setLocation(lat: Float, lng: Float)
LANGUAGE :