Skip to content

Latest commit

 

History

History
160 lines (113 loc) · 4.33 KB

migrate-from-v1.md

File metadata and controls

160 lines (113 loc) · 4.33 KB

TOP > Migration Guide: Migrate from V1 SDK

Table of Contents


Background

Version 1.x SDK is a legacy SDK, starting from version 2.x there are significant changes. This document provide a guide on how to migrate from version 1.x SDK and the required changes.

This document will also share some new features introduced since version 2.x.

Version history

For all version history. Please refer here to version history

Integration Guide

In version 1.x we only support integration using Cocoapods. In the newer version, we also support integration using Carthage and SwiftPM.

Use Cocoapods

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/rakuten-ads/Rakuten-Reward-Native-iOS.git'

target '' do
pod 'RakutenRewardNativeSDK', '5.0.0'
end

Via Swift Package Manager (SPM) - Support starting from SDK version 3.4.4

Add the dependency value below

dependencies: [
    .package(url: "https://github.com/rakuten-ads/Rakuten-Reward-Native-iOS-SPM", .exact("5.0.0")),
]

Via Carthage - Support starting from SDK version 3.3.0

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"

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

M1 support

Starting from Q4 2020, Apple released the M1 laptop. To support the new architecture, we provided an updated SDK starting from version 3.4.3.

API changes on version 3.6.0


SupportPage enum

Old New
Help help
TermsCondition termsCondition
PrivacyPolicy privacyPolicy


RakutenRewardStatus enum

Old New
Online online
Offline offline
AppcodeInvalid appcodeInvalid
TokenExpired tokenExpired


SDKError enum

Old New
NoMissionFound noMissionFound
NoUnclaimedItemFound noUnclaimedItemFound
SessionNotInitialized sessionNotInitialized
FeatureDisabledByUser featureDisabledByUser
SDKStatusNotOnline sdkStatusNotOnline


RakutenRewardRegion enum

Old New
JP japan


TokenType enum

Old New
RID rid
RAE rae
RakutenAuth rakutenAuth

Clear Token

To clear access token and user data when user log out, please use the following API:

@objc public func logout(completion: () -> Void)


Example

RakutenReward.shared.logout {
    // Completion
}

Removed Features

Action History - removed in version 3.6.0

SDK will not be saving action codes from failed log action and will not be retry log action anymore when API call fails.

New Features

New Notification Type

There are 2 new mission achieved notification types added since version 3.5.0.

  • Small Ad Banner
  • Big Ad Banner

Small Ad Banner

Big Ad Banner

User Consent Feature

In Reward SDK version 5.0.0, we added support for User Consent feature where user have to provide consent before accessing Rewards Service.
Please refer here for more details.

* Currently this feature is not enabled yet

Consent Dialog