diff --git a/ios/Classes/Api/MOP_registerSyncExtensionApi.m b/ios/Classes/Api/MOP_registerSyncExtensionApi.m index c399518..919e8d0 100644 --- a/ios/Classes/Api/MOP_registerSyncExtensionApi.m +++ b/ios/Classes/Api/MOP_registerSyncExtensionApi.m @@ -17,6 +17,8 @@ NSLog(@"MOP_registerSyncExtensionApi,name=%@",self.name); FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel]; [[FATClient sharedClient] registerSyncExtensionApi:self.name handler:^NSDictionary *(FATAppletInfo *appletInfo, id param) { + NSLog(@"MOP_registerSyncExtensionApi handler,name=%@ %@",self.name,[PhizLanguageData sharedInstance].languageCode); + if([self.name isEqualToString:@"getLanguageCodeSync"]){ NSDictionary *resultDict = [NSDictionary dictionary]; NSString* shortCode = [PhizLanguageData sharedInstance].languageCode; diff --git a/ios/Classes/Api/PhizLanguageData.m b/ios/Classes/Api/PhizLanguageData.m index 2280122..941bab3 100644 --- a/ios/Classes/Api/PhizLanguageData.m +++ b/ios/Classes/Api/PhizLanguageData.m @@ -13,7 +13,7 @@ static PhizLanguageData *sharedInstance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - sharedInstance = [[self alloc] init]; + sharedInstance = [[PhizLanguageData alloc] init]; sharedInstance.languageCode = @"en"; // Set default language code sharedInstance.countryCode = @"US"; }); diff --git a/ios/Classes/MopPlugin.m b/ios/Classes/MopPlugin.m index 4b7e617..be7bb5e 100644 --- a/ios/Classes/MopPlugin.m +++ b/ios/Classes/MopPlugin.m @@ -79,7 +79,9 @@ static MopPlugin *_instance; - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { - if ([@"getPlatformVersion" isEqualToString:call.method]) { + NSLog(@"handleMethodCall, %@ %@",call.method,call.arguments); + + if ([@"getPlatformVersion" isEqualToString:call.method]) { result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]); } else if ([@"getAppletInfo" isEqualToString:call.method]) { @@ -143,7 +145,7 @@ static MopPlugin *_instance; } } else if ([@"updateLanguage" isEqualToString:call.method]) { - NSLog(@"updateLanguage,"); + NSLog(@"updateLanguage,"); NSString *cCode = call.arguments[@"countryCode"]; NSString *cLang = call.arguments[@"languageCode"]; [PhizLanguageData sharedInstance].countryCode = cCode;