TOP > Migration Guide: Migrate from V1 SDK
Table of Contents
- Background
- Version History
- Integration Guide
- M1 support
- API changes on version 3.6.0
- Clear Token
- Removed Features
- New Features
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.
For all version history. Please refer here to version history
In version 1.x we only support integration using Cocoapods. In the newer version, we also support integration using Carthage and SwiftPM.
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
Add the dependency value below
dependencies: [
.package(url: "https://github.com/rakuten-ads/Rakuten-Reward-Native-iOS-SPM", .exact("5.0.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
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.
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 |
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
}
SDK will not be saving action codes from failed log action and will not be retry log action anymore when API call fails.
There are 2 new mission achieved notification types added since version 3.5.0.
- Small Ad Banner
- Big Ad Banner
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