|
@@ -254,7 +254,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
|
|
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
|
|
// message.body -- Allowed types are NSNumber, NSString, NSDate, NSArray,NSDictionary, and NSNull.
|
|
// message.body -- Allowed types are NSNumber, NSString, NSDate, NSArray,NSDictionary, and NSNull.
|
|
- NSLog(@"原生收到了js发送过来的消息message.name = %@ message.body = %@",message.name,message.body);
|
|
|
|
|
|
+// NSLog(@"原生收到了js发送过来的消息message.name = %@ message.body = %@",message.name,message.body);
|
|
if ([message.name isEqualToString:@"loginByWeixin"]) {
|
|
if ([message.name isEqualToString:@"loginByWeixin"]) {
|
|
[self jsLoginByWeixin:message.body];
|
|
[self jsLoginByWeixin:message.body];
|
|
}else if ([message.name isEqualToString:@"share"]) {
|
|
}else if ([message.name isEqualToString:@"share"]) {
|
|
@@ -310,7 +310,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
NSError *err = nil;
|
|
NSError *err = nil;
|
|
NSData *dataFromString = [prompt dataUsingEncoding:NSUTF8StringEncoding];
|
|
NSData *dataFromString = [prompt dataUsingEncoding:NSUTF8StringEncoding];
|
|
NSDictionary *paramdict = [NSJSONSerialization JSONObjectWithData:dataFromString options:NSJSONReadingMutableContainers error:&err];
|
|
NSDictionary *paramdict = [NSJSONSerialization JSONObjectWithData:dataFromString options:NSJSONReadingMutableContainers error:&err];
|
|
- NSLog(@"拦截prompt:%@",paramdict);
|
|
|
|
|
|
+// NSLog(@"拦截prompt:%@",paramdict);
|
|
if (!err){
|
|
if (!err){
|
|
NSString *type = [paramdict objectForKey:@"jsName"];
|
|
NSString *type = [paramdict objectForKey:@"jsName"];
|
|
if (type && [type isEqualToString:@"getUserToken"]) {
|
|
if (type && [type isEqualToString:@"getUserToken"]) {
|
|
@@ -486,10 +486,37 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
//监听购买结果
|
|
//监听购买结果
|
|
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
|
|
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ [self performSelector:@selector(rrrrrrr) withObject:nil afterDelay:5];
|
|
|
|
+}
|
|
|
|
+-(void)rrrrrrr {
|
|
|
|
+ //测试跳转抖音
|
|
|
|
+ NSURL *url = [NSURL URLWithString:@"snssdk1128://aweme/live"];
|
|
|
|
+ if ([[UIApplication sharedApplication] canOpenURL:url]) {
|
|
|
|
+ if ([[UIApplication sharedApplication] respondsToSelector:@selector(openURL:options:completionHandler:)]) {
|
|
|
|
+ //iOS 10.0+
|
|
|
|
+ NSLog(@"iOS 10+");
|
|
|
|
+ if (@available(iOS 10.0, *)) {
|
|
|
|
+ [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
|
|
|
|
+ }];
|
|
|
|
+ } else {
|
|
|
|
+ // Fallback on earlier versions
|
|
|
|
+ [[UIApplication sharedApplication] openURL:url];
|
|
|
|
+ }
|
|
|
|
+ [[UIApplication sharedApplication] openURL:url];
|
|
|
|
+ }else{
|
|
|
|
+ NSLog(@"iOS 2~10");
|
|
|
|
+ //iOS 2~10
|
|
|
|
+ [[UIApplication sharedApplication] openURL:url];
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ //一般是没有安装
|
|
|
|
+ NSLog(@"跳转下载app链接");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-(void)bottomOneListening {
|
|
-(void)bottomOneListening {
|
|
if(self.tabBarController.selectedIndex == 0) {
|
|
if(self.tabBarController.selectedIndex == 0) {
|
|
[self judgeIsHiddenBottom];
|
|
[self judgeIsHiddenBottom];
|