Skip to content

Latest commit

 

History

History
163 lines (123 loc) · 4.92 KB

README.md

File metadata and controls

163 lines (123 loc) · 4.92 KB

TOP > SPS feature

Table of Contents


Overview

Mission SDK provides a new feature which integrate Super Point Screen (SPS) Ad.
The purpose is to allow end users to earn SPS points.

Import SPS Library

Use Cocoapods

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

Via Carthage

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

Enable SPS feature

In order to use the SPS feature in Mission SDK, please ask SPS BU to enable the feature for your application.

Authentication

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.

ID SDK

The client app need to include the following audience and scopes in the CAT configuration.

Audience Scopes
rakuten_sp_scr_web
  • sps-basic
  • sps-point
  • sps-register
  • sps-fast-reg

Initialize SPS

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

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
    }
}

Show SPS Portal

The following API will display SPS Portal as shown below.
SPS Osusume Ad

RakutenReward.shared.openSpsPortal { result in
    // handle callback
}

Screenshots of the SPS Portal

SPS Home Page Mission Page

Non-SPS member

If the logged in user is not a SPS member, a member registration screen will be shown first.

SPS member registration

Claim Point Screen

Importing this SPS library will update the Claim Point screen as well.
Below is a screenshot of the new screen.
Claim Point screen

Theme Setting Screen

In the SPS Portal settings screen, users are able to set their desire theme.
Mode Settings Screen
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)

Opt Out Mission Feature

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

SPS no mission

Geolocation

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 :