log
parent
282b248e03
commit
0f74e0f6fc
|
@ -17,6 +17,8 @@
|
||||||
NSLog(@"MOP_registerSyncExtensionApi,name=%@",self.name);
|
NSLog(@"MOP_registerSyncExtensionApi,name=%@",self.name);
|
||||||
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
|
FlutterMethodChannel *channel = [[MopPlugin instance] methodChannel];
|
||||||
[[FATClient sharedClient] registerSyncExtensionApi:self.name handler:^NSDictionary *(FATAppletInfo *appletInfo, id param) {
|
[[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"]){
|
if([self.name isEqualToString:@"getLanguageCodeSync"]){
|
||||||
NSDictionary *resultDict = [NSDictionary dictionary];
|
NSDictionary *resultDict = [NSDictionary dictionary];
|
||||||
NSString* shortCode = [PhizLanguageData sharedInstance].languageCode;
|
NSString* shortCode = [PhizLanguageData sharedInstance].languageCode;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
static PhizLanguageData *sharedInstance = nil;
|
static PhizLanguageData *sharedInstance = nil;
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
sharedInstance = [[self alloc] init];
|
sharedInstance = [[PhizLanguageData alloc] init];
|
||||||
sharedInstance.languageCode = @"en"; // Set default language code
|
sharedInstance.languageCode = @"en"; // Set default language code
|
||||||
sharedInstance.countryCode = @"US";
|
sharedInstance.countryCode = @"US";
|
||||||
});
|
});
|
||||||
|
|
|
@ -79,7 +79,9 @@ static MopPlugin *_instance;
|
||||||
|
|
||||||
|
|
||||||
- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
|
- (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]]);
|
result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]);
|
||||||
}
|
}
|
||||||
else if ([@"getAppletInfo" isEqualToString:call.method]) {
|
else if ([@"getAppletInfo" isEqualToString:call.method]) {
|
||||||
|
@ -143,7 +145,7 @@ static MopPlugin *_instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ([@"updateLanguage" isEqualToString:call.method]) {
|
else if ([@"updateLanguage" isEqualToString:call.method]) {
|
||||||
NSLog(@"updateLanguage,");
|
NSLog(@"updateLanguage,");
|
||||||
NSString *cCode = call.arguments[@"countryCode"];
|
NSString *cCode = call.arguments[@"countryCode"];
|
||||||
NSString *cLang = call.arguments[@"languageCode"];
|
NSString *cLang = call.arguments[@"languageCode"];
|
||||||
[PhizLanguageData sharedInstance].countryCode = cCode;
|
[PhizLanguageData sharedInstance].countryCode = cCode;
|
||||||
|
|
Loading…
Reference in New Issue