Cập nhật SDK 5.1.4
Lịch sử thay đổi và cấu hình Podfile khi cập nhật iTapSDK iOS lên phiên bản 5.1.4.
1. Tóm tắt thay đổi
Phần tiêu đề “1. Tóm tắt thay đổi”- Cập nhật AppsFlyerFramework lên 6.17.7.
- Cập nhật tính năng nhận quà (Receive Gift).
- Cập nhật tính năng chuyển tài khoản (Switch account).
2. Cập nhật Podfile
Phần tiêu đề “2. Cập nhật Podfile”Sửa lại Podfile như bên dưới, sau đó chạy lại pod install:
platform :ios, '15.0'target 'SdkExample' do use_frameworks! pod 'GoogleSignIn', '7.1.0' pod 'Firebase', '12.0.0' pod 'FirebaseMessaging', '12.0.0' pod 'FirebaseRemoteConfig', '12.0.0' pod 'AppsFlyerFramework', '6.17.7' pod 'JWT', '2.2.0' pod 'TikTokBusinessSDK', '1.5.0' pod 'FirebaseRemoteConfig', '12.0.0' pod 'FirebaseCrashlytics', '12.0.0'endtarget 'FirebaseNotificationServiceExtension' do use_frameworks! pod 'Firebase', '12.0.0' pod 'FirebaseMessaging', '12.0.0'
endpost_install do |lib| lib.pods_project.targets.each do |target| if target.name == 'GoogleSignIn' || target.name == 'Firebase' || target.name == 'FirebaseCrashlytics'|| target.name == 'FirebaseRemoteConfig' || target.name == 'FirebaseMessaging' || target.name == 'AppsFlyerFramework' || target.name == 'JWT' || target.name == 'TikTokBusinessSDK' target.build_configurations.each do |config| config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' end end
target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0' end endendSau đó chạy lệnh để cài lại dependencies cho sạch:
pod cache clean --allpod deintegratepod install3. Cập nhật AppDelegate
Phần tiêu đề “3. Cập nhật AppDelegate”Cập nhật AppDelegate.m theo mẫu dưới đây để khớp với phiên bản SDK mới:
@import Firebase;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[Sdk sharedInstance] initWithDelegate:self application:application launchOptions:launchOptions isProdEnv:TRUE]; [[Sdk sharedInstance] setLocationFloatingButton:20 with:100]; [[Sdk sharedInstance] setGrantEnv:NO]; return YES;}
-(void) getLangaugeSdk: (NSString *) langauge { // Xử lý khi ngôn ngữ SDK thay đổi}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { [FIRMessaging messaging].APNSToken = deviceToken;}
- (void)messaging:(FIRMessaging *)messaging didReceiveRegistrationToken:(NSString *)fcmToken {}
4. Nhận quà (Receive Gift)
Phần tiêu đề “4. Nhận quà (Receive Gift)”Khi người dùng bấm nút hộp quà (gift box), gọi hàm sau:
[[Sdk sharedInstance] showReceiveGift];