SohaSDK for iOS 1.3.x.x Migration Guide¶
This guide is provided in order to ease the transition of existing applications using SohaSDK 1.2.x.x to the latest APIs, as well as explain the design and structure of new and updated functionality.
Requirements¶
- iOS 13.0
- Xcode 15.3
Benefits of Upgrading¶
- Less code: Up to 30 % less code to write.
- Less file size: Binary artifact sizes are now smaller.
- Intuitive: The APIs are intuitive - easy to discover and use.
- Accelerate development
Namespace Changes¶
You will notice that previous uses of Soha
no longer can be found. In any file you are using the SohaGame iOS SDK please add to the top of the file:
PayListModel
has been renamed to SohaIAPProductList
.
SohaIAPModel
has been renamed to SohaIAPProduct
.
Updating method calls¶
Added¶
A new feature of 1.3.x.x is register the remote push notification and handle the notification center's delegate for you.
Updated¶
Initialization¶
Enable Tracking Pre Alert Screen¶
Info
In version 1.3.0.1, SohaGame SDK will not automatically display popup requesting tracking authorization (for iOS versions 14.5 and above). You need to request tracking authorization manually. The SDK also provides a requestTracking
method to present App Tracking Transparency authorization request.
Logout¶
Delete Account¶
Change SDK language¶
SohaSetting¶
SohaDelegate Protocol¶
- (void)sohaLoginDelegate:(SohaUser *)user{
}
- (void)sohaLogoutDelegate:(SohaUser *)user{
}
- (void)sohaDeleteAccountDelegate:(SohaUser *)user{
}
- (void)sohaDidPurchaseSuccess:(SohaTransaction *)transaction{
}
- (void)sohaDidPurchaseFailed:(SohaTransaction *)transaction purchaseError:(NSString *)error{
}
Push Notification¶
Register Device Token
UNUserNotificationCenterDelegate
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler{
[Soha userNotificationCenter:center didReceiveNotificationResponse:response];
}
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler{
[Soha userNotificationCenter:center willPresentNotification:notification];
}
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler{
[SohaSDK didReceiveNotificationResponse:response];
}
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler{
[SohaSDK willPresentNotification:notification];
}
In-App Purchase¶
Open the SDK's Payment Center
Log Events¶
Event logging methods in version 1.3.x.x have changed a lot. Event logging methods now have a more explicit and intuitive syntax.
create_characte event:
set_role event:
complete_tutorial event:
shg_first_purchase event:
Vote app event:
Custom event:
Removed¶
sohaLoginDelegate
method of SohaDelegate
protocol has been removed.
sohaHandleDidBecomeActive
has been removed.
sohaHandleDidEnterBackground
has been removed.
sohaHandleDidEnterForeground
has been removed.
sohaHandleWillTerminate
has been removed.