diff options
Diffstat (limited to 'StoneIsland/platforms/ios/Stone Island')
35 files changed, 301 insertions, 979 deletions
diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/1024x1024bb.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/1024x1024bb.png Binary files differdeleted file mode 100644 index ee0b3903..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/1024x1024bb.png +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/Contents.json b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/Contents.json index 56254c1d..4c005a7e 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/Contents.json @@ -3,152 +3,157 @@ { "idiom" : "iphone", "size" : "20x20", + "filename" : "icon-20@2x.png", "scale" : "2x" }, { "idiom" : "iphone", "size" : "20x20", + "filename" : "icon-20@3x.png", "scale" : "3x" }, { - "size" : "29x29", "idiom" : "iphone", + "size" : "29x29", "filename" : "icon-small.png", "scale" : "1x" }, { - "size" : "29x29", "idiom" : "iphone", + "size" : "29x29", "filename" : "icon-small@2x.png", "scale" : "2x" }, { - "size" : "29x29", "idiom" : "iphone", + "size" : "29x29", "filename" : "icon-small@3x.png", "scale" : "3x" }, { - "size" : "40x40", "idiom" : "iphone", + "size" : "40x40", "filename" : "icon-40@2x.png", "scale" : "2x" }, { - "size" : "40x40", "idiom" : "iphone", + "size" : "40x40", "filename" : "icon-60@2x.png", "scale" : "3x" }, { - "size" : "57x57", "idiom" : "iphone", + "size" : "57x57", "filename" : "icon.png", "scale" : "1x" }, { - "size" : "57x57", "idiom" : "iphone", + "size" : "57x57", "filename" : "icon@2x.png", "scale" : "2x" }, { - "size" : "60x60", "idiom" : "iphone", + "size" : "60x60", "filename" : "icon-60@2x.png", "scale" : "2x" }, { - "size" : "60x60", "idiom" : "iphone", + "size" : "60x60", "filename" : "icon-60@3x.png", "scale" : "3x" }, { "idiom" : "ipad", "size" : "20x20", + "filename" : "icon-20.png", "scale" : "1x" }, { "idiom" : "ipad", "size" : "20x20", + "filename" : "icon-20@2x.png", "scale" : "2x" }, { - "size" : "29x29", "idiom" : "ipad", + "size" : "29x29", "filename" : "icon-small.png", "scale" : "1x" }, { - "size" : "29x29", "idiom" : "ipad", + "size" : "29x29", "filename" : "icon-small@2x.png", "scale" : "2x" }, { - "size" : "40x40", "idiom" : "ipad", + "size" : "40x40", "filename" : "icon-40.png", "scale" : "1x" }, { - "size" : "40x40", "idiom" : "ipad", + "size" : "40x40", "filename" : "icon-40@2x.png", "scale" : "2x" }, { - "size" : "50x50", "idiom" : "ipad", + "size" : "50x50", "filename" : "icon-50.png", "scale" : "1x" }, { - "size" : "50x50", "idiom" : "ipad", + "size" : "50x50", "filename" : "icon-50@2x.png", "scale" : "2x" }, { - "size" : "72x72", "idiom" : "ipad", + "size" : "72x72", "filename" : "icon-72.png", "scale" : "1x" }, { - "size" : "72x72", "idiom" : "ipad", + "size" : "72x72", "filename" : "icon-72@2x.png", "scale" : "2x" }, { - "size" : "76x76", "idiom" : "ipad", + "size" : "76x76", "filename" : "icon-76.png", "scale" : "1x" }, { - "size" : "76x76", "idiom" : "ipad", + "size" : "76x76", "filename" : "icon-76@2x.png", "scale" : "2x" }, { - "size" : "83.5x83.5", "idiom" : "ipad", + "size" : "83.5x83.5", "filename" : "icon-83.5@2x.png", "scale" : "2x" }, { "size" : "1024x1024", "idiom" : "ios-marketing", - "filename" : "1024x1024bb.png", + "filename" : "icon-1024.png", "scale" : "1x" }, { "size" : "24x24", "idiom" : "watch", + "filename" : "AppIcon24x24@2x.png", "scale" : "2x", "role" : "notificationCenter", "subtype" : "38mm" @@ -156,6 +161,7 @@ { "size" : "27.5x27.5", "idiom" : "watch", + "filename" : "AppIcon27.5x27.5@2x.png", "scale" : "2x", "role" : "notificationCenter", "subtype" : "42mm" @@ -163,18 +169,21 @@ { "size" : "29x29", "idiom" : "watch", + "filename" : "AppIcon29x29@2x.png", "role" : "companionSettings", "scale" : "2x" }, { "size" : "29x29", "idiom" : "watch", + "filename" : "AppIcon29x29@3x.png", "role" : "companionSettings", "scale" : "3x" }, { "size" : "40x40", "idiom" : "watch", + "filename" : "AppIcon40x40@2x.png", "scale" : "2x", "role" : "appLauncher", "subtype" : "38mm" @@ -182,6 +191,7 @@ { "size" : "44x44", "idiom" : "watch", + "filename" : "AppIcon44x44@2x.png", "scale" : "2x", "role" : "longLook", "subtype" : "42mm" @@ -189,6 +199,7 @@ { "size" : "86x86", "idiom" : "watch", + "filename" : "AppIcon86x86@2x.png", "scale" : "2x", "role" : "quickLook", "subtype" : "38mm" @@ -196,13 +207,15 @@ { "size" : "98x98", "idiom" : "watch", + "filename" : "AppIcon98x98@2x.png", "scale" : "2x", "role" : "quickLook", "subtype" : "42mm" }, { - "idiom" : "watch-marketing", "size" : "1024x1024", + "idiom" : "watch-marketing", + "filename" : "icon-1024.png", "scale" : "1x" } ], @@ -210,4 +223,4 @@ "version" : 1, "author" : "xcode" } -}
\ No newline at end of file +} diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40.png Binary files differindex d2617e23..e865adbc 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40@2x.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40@2x.png Binary files differindex 1813fa48..6d07dce5 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40@2x.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50.png Binary files differindex 531435f3..98a9d96d 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50@2x.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50@2x.png Binary files differindex dffdf8ba..bac693f7 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50@2x.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60.png Binary files differdeleted file mode 100644 index dd612e83..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60.png +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@2x.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@2x.png Binary files differindex 23c5b259..955af362 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@2x.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@3x.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@3x.png Binary files differindex da2863a4..e1268916 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@3x.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@3x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72.png Binary files differindex 3094af16..8c6e5df3 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72@2x.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72@2x.png Binary files differindex 9515e8dc..dd819da6 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72@2x.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76.png Binary files differindex 93e7a05d..63afe7f1 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76@2x.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76@2x.png Binary files differindex 351f06c9..4cff29a2 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76@2x.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png Binary files differindex 52bafc1d..3c1a0115 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small.png Binary files differindex cbe03b26..0ea1c42f 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@2x.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@2x.png Binary files differindex 8e3a96d6..2c72038e 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@2x.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@3x.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@3x.png Binary files differindex a40b6358..5c37dfc2 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@3x.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@3x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon.png Binary files differindex 2c9b6664..b2571a71 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon@2x.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon@2x.png Binary files differindex cf5b68db..d75098f5 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon@2x.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png Binary files differindex 50dcc57f..eae0792d 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchStoryboard.imageset/Contents.json b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchStoryboard.imageset/Contents.json index 621019de..a044a08d 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchStoryboard.imageset/Contents.json +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchStoryboard.imageset/Contents.json @@ -38,7 +38,8 @@ }, { "idiom": "universal", - "scale": "2x" + "scale": "2x", + "filename": "Default@2x~universal~anyany.png" }, { "idiom": "universal", diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchStoryboard.imageset/Default@2x~universal~anyany.png b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchStoryboard.imageset/Default@2x~universal~anyany.png Binary files differnew file mode 100644 index 00000000..507cf688 --- /dev/null +++ b/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchStoryboard.imageset/Default@2x~universal~anyany.png diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-console/CDVLogger.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-console/CDVLogger.h deleted file mode 100644 index 7cfb3063..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-console/CDVLogger.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import <Cordova/CDVPlugin.h> - -@interface CDVLogger : CDVPlugin - -- (void)logLevel:(CDVInvokedUrlCommand*)command; - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-console/CDVLogger.m b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-console/CDVLogger.m deleted file mode 100644 index ccfa3a51..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-console/CDVLogger.m +++ /dev/null @@ -1,38 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVLogger.h" -#import <Cordova/CDV.h> - -@implementation CDVLogger - -/* log a message */ -- (void)logLevel:(CDVInvokedUrlCommand*)command -{ - id level = [command argumentAtIndex:0]; - id message = [command argumentAtIndex:1]; - - if ([level isEqualToString:@"LOG"]) { - NSLog(@"%@", message); - } else { - NSLog(@"%@: %@", level, message); - } -} - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.m b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.m index 8ad8116b..ab97055a 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.m +++ b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.m @@ -178,11 +178,26 @@ return device; } +- (BOOL) isUsingCDVLaunchScreen { + NSString* launchStoryboardName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"]; + if (launchStoryboardName) { + return ([launchStoryboardName isEqualToString:@"CDVLaunchScreen"]); + } else { + return NO; + } +} + - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id<CDVScreenOrientationDelegate>)orientationDelegate device:(CDV_iOSDevice)device { // Use UILaunchImageFile if specified in plist. Otherwise, use Default. NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"]; + // detect if we are using CB-9762 Launch Storyboard; if so, return the associated image instead + if ([self isUsingCDVLaunchScreen]) { + imageName = @"LaunchStoryboard"; + return imageName; + } + NSUInteger supportedOrientations = [orientationDelegate supportedInterfaceOrientations]; // Checks to see if the developer has locked the orientation to use only one of Portrait or Landscape @@ -334,6 +349,14 @@ - (void)updateBounds { + if ([self isUsingCDVLaunchScreen]) { + // CB-9762's launch screen expects the image to fill the screen and be scaled using AspectFill. + CGSize viewportSize = [UIApplication sharedApplication].delegate.window.bounds.size; + _imageView.frame = CGRectMake(0, 0, viewportSize.width, viewportSize.height); + _imageView.contentMode = UIViewContentModeScaleAspectFill; + return; + } + UIImage* img = _imageView.image; CGRect imgBounds = (img) ? CGRectMake(0, 0, img.size.width, img.size.height) : CGRectZero; diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKProcessPoolFactory.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKProcessPoolFactory.h deleted file mode 100644 index f4f8816e..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKProcessPoolFactory.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import <WebKit/WebKit.h> - -@interface CDVWKProcessPoolFactory : NSObject -@property (nonatomic, retain) WKProcessPool* sharedPool; - -+(instancetype) sharedFactory; --(WKProcessPool*) sharedProcessPool; -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKProcessPoolFactory.m b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKProcessPoolFactory.m deleted file mode 100644 index 48ac09e6..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKProcessPoolFactory.m +++ /dev/null @@ -1,49 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import <Foundation/Foundation.h> -#import <WebKit/WebKit.h> -#import "CDVWKProcessPoolFactory.h" - -static CDVWKProcessPoolFactory *factory = nil; - -@implementation CDVWKProcessPoolFactory - -+ (instancetype)sharedFactory -{ - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - factory = [[CDVWKProcessPoolFactory alloc] init]; - }); - - return factory; -} - -- (instancetype)init -{ - if (self = [super init]) { - _sharedPool = [[WKProcessPool alloc] init]; - } - return self; -} - -- (WKProcessPool*) sharedProcessPool { - return _sharedPool; -} -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewEngine.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewEngine.h deleted file mode 100644 index 2fe4bc21..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewEngine.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import <WebKit/WebKit.h> -#import <Cordova/CDV.h> - -@interface CDVWKWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol, WKScriptMessageHandler, WKNavigationDelegate> - -@property (nonatomic, strong, readonly) id <WKUIDelegate> uiDelegate; - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewEngine.m b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewEngine.m deleted file mode 100644 index e9ff2466..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewEngine.m +++ /dev/null @@ -1,480 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVWKWebViewEngine.h" -#import "CDVWKWebViewUIDelegate.h" -#import "CDVWKProcessPoolFactory.h" -#import <Cordova/NSDictionary+CordovaPreferences.h> - -#import <objc/message.h> - -#define CDV_BRIDGE_NAME @"cordova" -#define CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR @"loadFileURL:allowingReadAccessToURL:" - -@interface CDVWKWeakScriptMessageHandler : NSObject <WKScriptMessageHandler> - -@property (nonatomic, weak, readonly) id<WKScriptMessageHandler>scriptMessageHandler; - -- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler; - -@end - - -@interface CDVWKWebViewEngine () - -@property (nonatomic, strong, readwrite) UIView* engineWebView; -@property (nonatomic, strong, readwrite) id <WKUIDelegate> uiDelegate; -@property (nonatomic, weak) id <WKScriptMessageHandler> weakScriptMessageHandler; - -@end - -// see forwardingTargetForSelector: selector comment for the reason for this pragma -#pragma clang diagnostic ignored "-Wprotocol" - -@implementation CDVWKWebViewEngine - -@synthesize engineWebView = _engineWebView; - -- (instancetype)initWithFrame:(CGRect)frame -{ - self = [super init]; - if (self) { - if (NSClassFromString(@"WKWebView") == nil) { - return nil; - } - - self.engineWebView = [[WKWebView alloc] initWithFrame:frame]; - } - - return self; -} - -- (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings -{ - WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init]; - configuration.processPool = [[CDVWKProcessPoolFactory sharedFactory] sharedProcessPool]; - if (settings == nil) { - return configuration; - } - - configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO]; - configuration.mediaPlaybackRequiresUserAction = [settings cordovaBoolSettingForKey:@"MediaPlaybackRequiresUserAction" defaultValue:YES]; - configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO]; - configuration.mediaPlaybackAllowsAirPlay = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES]; - return configuration; -} - -- (void)pluginInitialize -{ - // viewController would be available now. we attempt to set all possible delegates to it, by default - NSDictionary* settings = self.commandDelegate.settings; - - self.uiDelegate = [[CDVWKWebViewUIDelegate alloc] initWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]]; - - CDVWKWeakScriptMessageHandler *weakScriptMessageHandler = [[CDVWKWeakScriptMessageHandler alloc] initWithScriptMessageHandler:self]; - - WKUserContentController* userContentController = [[WKUserContentController alloc] init]; - [userContentController addScriptMessageHandler:weakScriptMessageHandler name:CDV_BRIDGE_NAME]; - - WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings]; - configuration.userContentController = userContentController; - - // re-create WKWebView, since we need to update configuration - WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration]; - wkWebView.UIDelegate = self.uiDelegate; - self.engineWebView = wkWebView; - - if (IsAtLeastiOSVersion(@"9.0") && [self.viewController isKindOfClass:[CDVViewController class]]) { - wkWebView.customUserAgent = ((CDVViewController*) self.viewController).userAgent; - } - - if ([self.viewController conformsToProtocol:@protocol(WKUIDelegate)]) { - wkWebView.UIDelegate = (id <WKUIDelegate>)self.viewController; - } - - if ([self.viewController conformsToProtocol:@protocol(WKNavigationDelegate)]) { - wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self.viewController; - } else { - wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self; - } - - if ([self.viewController conformsToProtocol:@protocol(WKScriptMessageHandler)]) { - [wkWebView.configuration.userContentController addScriptMessageHandler:(id < WKScriptMessageHandler >)self.viewController name:CDV_BRIDGE_NAME]; - } - - [self updateSettings:settings]; - - // check if content thread has died on resume - NSLog(@"%@", @"CDVWKWebViewEngine will reload WKWebView if required on resume"); - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(onAppWillEnterForeground:) - name:UIApplicationWillEnterForegroundNotification object:nil]; - - NSLog(@"Using WKWebView"); - - [self addURLObserver]; -} - -- (void)onReset { - [self addURLObserver]; -} - -static void * KVOContext = &KVOContext; - -- (void)addURLObserver { - if(!IsAtLeastiOSVersion(@"9.0")){ - [self.webView addObserver:self forKeyPath:@"URL" options:0 context:KVOContext]; - } -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context -{ - if (context == KVOContext) { - if (object == [self webView] && [keyPath isEqualToString: @"URL"] && [object valueForKeyPath:keyPath] == nil){ - NSLog(@"URL is nil. Reloading WKWebView"); - [(WKWebView*)_engineWebView reload]; - } - } else { - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; - } -} - -- (void) onAppWillEnterForeground:(NSNotification*)notification { - if ([self shouldReloadWebView]) { - NSLog(@"%@", @"CDVWKWebViewEngine reloading!"); - [(WKWebView*)_engineWebView reload]; - } -} - -- (BOOL)shouldReloadWebView -{ - WKWebView* wkWebView = (WKWebView*)_engineWebView; - return [self shouldReloadWebView:wkWebView.URL title:wkWebView.title]; -} - -- (BOOL)shouldReloadWebView:(NSURL*)location title:(NSString*)title -{ - BOOL title_is_nil = (title == nil); - BOOL location_is_blank = [[location absoluteString] isEqualToString:@"about:blank"]; - - BOOL reload = (title_is_nil || location_is_blank); - -#ifdef DEBUG - NSLog(@"%@", @"CDVWKWebViewEngine shouldReloadWebView::"); - NSLog(@"CDVWKWebViewEngine shouldReloadWebView title: %@", title); - NSLog(@"CDVWKWebViewEngine shouldReloadWebView location: %@", [location absoluteString]); - NSLog(@"CDVWKWebViewEngine shouldReloadWebView reload: %u", reload); -#endif - - return reload; -} - - -- (id)loadRequest:(NSURLRequest*)request -{ - if ([self canLoadRequest:request]) { // can load, differentiate between file urls and other schemes - if (request.URL.fileURL) { - SEL wk_sel = NSSelectorFromString(CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR); - NSURL* readAccessUrl = [request.URL URLByDeletingLastPathComponent]; - return ((id (*)(id, SEL, id, id))objc_msgSend)(_engineWebView, wk_sel, request.URL, readAccessUrl); - } else { - return [(WKWebView*)_engineWebView loadRequest:request]; - } - } else { // can't load, print out error - NSString* errorHtml = [NSString stringWithFormat: - @"<!doctype html>" - @"<title>Error</title>" - @"<div style='font-size:2em'>" - @" <p>The WebView engine '%@' is unable to load the request: %@</p>" - @" <p>Most likely the cause of the error is that the loading of file urls is not supported in iOS %@.</p>" - @"</div>", - NSStringFromClass([self class]), - [request.URL description], - [[UIDevice currentDevice] systemVersion] - ]; - return [self loadHTMLString:errorHtml baseURL:nil]; - } -} - -- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL -{ - return [(WKWebView*)_engineWebView loadHTMLString:string baseURL:baseURL]; -} - -- (NSURL*) URL -{ - return [(WKWebView*)_engineWebView URL]; -} - -- (BOOL) canLoadRequest:(NSURLRequest*)request -{ - // See: https://issues.apache.org/jira/browse/CB-9636 - SEL wk_sel = NSSelectorFromString(CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR); - - // if it's a file URL, check whether WKWebView has the selector (which is in iOS 9 and up only) - if (request.URL.fileURL) { - return [_engineWebView respondsToSelector:wk_sel]; - } else { - return YES; - } -} - -- (void)updateSettings:(NSDictionary*)settings -{ - WKWebView* wkWebView = (WKWebView*)_engineWebView; - - wkWebView.configuration.preferences.minimumFontSize = [settings cordovaFloatSettingForKey:@"MinimumFontSize" defaultValue:0.0]; - - /* - wkWebView.configuration.preferences.javaScriptEnabled = [settings cordovaBoolSettingForKey:@"JavaScriptEnabled" default:YES]; - wkWebView.configuration.preferences.javaScriptCanOpenWindowsAutomatically = [settings cordovaBoolSettingForKey:@"JavaScriptCanOpenWindowsAutomatically" default:NO]; - */ - - // By default, DisallowOverscroll is false (thus bounce is allowed) - BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]); - - // prevent webView from bouncing - if (!bounceAllowed) { - if ([wkWebView respondsToSelector:@selector(scrollView)]) { - ((UIScrollView*)[wkWebView scrollView]).bounces = NO; - } else { - for (id subview in wkWebView.subviews) { - if ([[subview class] isSubclassOfClass:[UIScrollView class]]) { - ((UIScrollView*)subview).bounces = NO; - } - } - } - } - - NSString* decelerationSetting = [settings cordovaSettingForKey:@"WKWebViewDecelerationSpeed"]; - if (!decelerationSetting) { - // Fallback to the UIWebView-named preference - decelerationSetting = [settings cordovaSettingForKey:@"UIWebViewDecelerationSpeed"]; - } - - if (![@"fast" isEqualToString:decelerationSetting]) { - [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal]; - } else { - [wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateFast]; - } - - wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:@"AllowBackForwardNavigationGestures" defaultValue:NO]; -} - -- (void)updateWithInfo:(NSDictionary*)info -{ - NSDictionary* scriptMessageHandlers = [info objectForKey:kCDVWebViewEngineScriptMessageHandlers]; - NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences]; - id navigationDelegate = [info objectForKey:kCDVWebViewEngineWKNavigationDelegate]; - id uiDelegate = [info objectForKey:kCDVWebViewEngineWKUIDelegate]; - - WKWebView* wkWebView = (WKWebView*)_engineWebView; - - if (scriptMessageHandlers && [scriptMessageHandlers isKindOfClass:[NSDictionary class]]) { - NSArray* allKeys = [scriptMessageHandlers allKeys]; - - for (NSString* key in allKeys) { - id object = [scriptMessageHandlers objectForKey:key]; - if ([object conformsToProtocol:@protocol(WKScriptMessageHandler)]) { - [wkWebView.configuration.userContentController addScriptMessageHandler:object name:key]; - } - } - } - - if (navigationDelegate && [navigationDelegate conformsToProtocol:@protocol(WKNavigationDelegate)]) { - wkWebView.navigationDelegate = navigationDelegate; - } - - if (uiDelegate && [uiDelegate conformsToProtocol:@protocol(WKUIDelegate)]) { - wkWebView.UIDelegate = uiDelegate; - } - - if (settings && [settings isKindOfClass:[NSDictionary class]]) { - [self updateSettings:settings]; - } -} - -// This forwards the methods that are in the header that are not implemented here. -// Both WKWebView and UIWebView implement the below: -// loadHTMLString:baseURL: -// loadRequest: -- (id)forwardingTargetForSelector:(SEL)aSelector -{ - return _engineWebView; -} - -- (UIView*)webView -{ - return self.engineWebView; -} - -#pragma mark WKScriptMessageHandler implementation - -- (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message -{ - if (![message.name isEqualToString:CDV_BRIDGE_NAME]) { - return; - } - - CDVViewController* vc = (CDVViewController*)self.viewController; - - NSArray* jsonEntry = message.body; // NSString:callbackId, NSString:service, NSString:action, NSArray:args - CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry]; - CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName); - - if (![vc.commandQueue execute:command]) { -#ifdef DEBUG - NSError* error = nil; - NSString* commandJson = nil; - NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonEntry - options:0 - error:&error]; - - if (error == nil) { - commandJson = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; - } - - static NSUInteger maxLogLength = 1024; - NSString* commandString = ([commandJson length] > maxLogLength) ? - [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] : - commandJson; - - NSLog(@"FAILED pluginJSON = %@", commandString); -#endif - } -} - -#pragma mark WKNavigationDelegate implementation - -- (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(WKNavigation*)navigation -{ - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:webView]]; -} - -- (void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation -{ - CDVViewController* vc = (CDVViewController*)self.viewController; - [CDVUserAgentUtil releaseLock:vc.userAgentLockToken]; - - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:webView]]; -} - -- (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(WKNavigation*)navigation withError:(NSError*)error -{ - [self webView:theWebView didFailNavigation:navigation withError:error]; -} - -- (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigation withError:(NSError*)error -{ - CDVViewController* vc = (CDVViewController*)self.viewController; - [CDVUserAgentUtil releaseLock:vc.userAgentLockToken]; - - NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]]; - NSLog(@"%@", message); - - NSURL* errorUrl = vc.errorURL; - if (errorUrl) { - errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] relativeToURL:errorUrl]; - NSLog(@"%@", [errorUrl absoluteString]); - [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]]; - } -} - -- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView -{ - [webView reload]; -} - -- (BOOL)defaultResourcePolicyForURL:(NSURL*)url -{ - // all file:// urls are allowed - if ([url isFileURL]) { - return YES; - } - - return NO; -} - -- (void) webView: (WKWebView *) webView decidePolicyForNavigationAction: (WKNavigationAction*) navigationAction decisionHandler: (void (^)(WKNavigationActionPolicy)) decisionHandler -{ - NSURL* url = [navigationAction.request URL]; - CDVViewController* vc = (CDVViewController*)self.viewController; - - /* - * Give plugins the chance to handle the url - */ - BOOL anyPluginsResponded = NO; - BOOL shouldAllowRequest = NO; - - for (NSString* pluginName in vc.pluginObjects) { - CDVPlugin* plugin = [vc.pluginObjects objectForKey:pluginName]; - SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:"); - if ([plugin respondsToSelector:selector]) { - anyPluginsResponded = YES; - // https://issues.apache.org/jira/browse/CB-12497 - int navType = (int)navigationAction.navigationType; - if (WKNavigationTypeOther == navigationAction.navigationType) { - navType = (int)UIWebViewNavigationTypeOther; - } - shouldAllowRequest = (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, navigationAction.request, navType)); - if (!shouldAllowRequest) { - break; - } - } - } - - if (anyPluginsResponded) { - return decisionHandler(shouldAllowRequest); - } - - /* - * Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview. - */ - BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:url]; - if (shouldAllowNavigation) { - return decisionHandler(YES); - } else { - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]]; - } - - return decisionHandler(NO); -} - -@end - -#pragma mark - CDVWKWeakScriptMessageHandler - -@implementation CDVWKWeakScriptMessageHandler - -- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler -{ - self = [super init]; - if (self) { - _scriptMessageHandler = scriptMessageHandler; - } - return self; -} - -- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message -{ - [self.scriptMessageHandler userContentController:userContentController didReceiveScriptMessage:message]; -} - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewUIDelegate.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewUIDelegate.h deleted file mode 100644 index 33a179b0..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewUIDelegate.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import <WebKit/WebKit.h> - -@interface CDVWKWebViewUIDelegate : NSObject <WKUIDelegate> - -@property (nonatomic, copy) NSString* title; - -- (instancetype)initWithTitle:(NSString*)title; - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewUIDelegate.m b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewUIDelegate.m deleted file mode 100644 index a7a16f2c..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-wkwebview-engine/CDVWKWebViewUIDelegate.m +++ /dev/null @@ -1,123 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - */ - -#import "CDVWKWebViewUIDelegate.h" - -@implementation CDVWKWebViewUIDelegate - -- (instancetype)initWithTitle:(NSString*)title -{ - self = [super init]; - if (self) { - self.title = title; - } - - return self; -} - -- (void) webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message - initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(void))completionHandler -{ - UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title - message:message - preferredStyle:UIAlertControllerStyleAlert]; - - UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction* action) - { - completionHandler(); - [alert dismissViewControllerAnimated:YES completion:nil]; - }]; - - [alert addAction:ok]; - - UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController; - - [rootController presentViewController:alert animated:YES completion:nil]; -} - -- (void) webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message - initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler -{ - UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title - message:message - preferredStyle:UIAlertControllerStyleAlert]; - - UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction* action) - { - completionHandler(YES); - [alert dismissViewControllerAnimated:YES completion:nil]; - }]; - - [alert addAction:ok]; - - UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction* action) - { - completionHandler(NO); - [alert dismissViewControllerAnimated:YES completion:nil]; - }]; - [alert addAction:cancel]; - - UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController; - - [rootController presentViewController:alert animated:YES completion:nil]; -} - -- (void) webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt - defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame - completionHandler:(void (^)(NSString* result))completionHandler -{ - UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title - message:prompt - preferredStyle:UIAlertControllerStyleAlert]; - - UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction* action) - { - completionHandler(((UITextField*)alert.textFields[0]).text); - [alert dismissViewControllerAnimated:YES completion:nil]; - }]; - - [alert addAction:ok]; - - UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction* action) - { - completionHandler(nil); - [alert dismissViewControllerAnimated:YES completion:nil]; - }]; - [alert addAction:cancel]; - - [alert addTextFieldWithConfigurationHandler:^(UITextField* textField) { - textField.text = defaultText; - }]; - - UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController; - - [rootController presentViewController:alert animated:YES completion:nil]; -} - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.h b/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.h index 4cc1dcb0..276a0080 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.h +++ b/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.h @@ -29,7 +29,7 @@ @protocol GGLInstanceIDDelegate; @protocol GCMReceiverDelegate; -@interface PushPlugin : CDVPlugin +@interface PushPlugin : CDVPlugin<GGLInstanceIDDelegate, GCMReceiverDelegate> { NSDictionary *notificationMessage; BOOL isInline; @@ -68,12 +68,13 @@ - (void)didSendDataMessageWithID:(NSString *)messageID; - (void)didDeleteMessagesOnServer; -// FCM Features -@property(nonatomic, assign) BOOL usesFCM; -@property(nonatomic, strong) NSNumber *fcmSandbox; -@property(nonatomic, strong) NSString *fcmSenderId; -@property(nonatomic, strong) NSDictionary *fcmRegistrationOptions; -@property(nonatomic, strong) NSString *fcmRegistrationToken; -@property(nonatomic, strong) NSArray *fcmTopics; +// GCM Features +@property(nonatomic, assign) BOOL usesGCM; +@property(nonatomic, strong) NSNumber* gcmSandbox; +@property(nonatomic, strong) NSString *gcmSenderId; +@property(nonatomic, strong) NSDictionary *gcmRegistrationOptions; +@property(nonatomic, strong) void (^gcmRegistrationHandler) (NSString *registrationToken, NSError *error); +@property(nonatomic, strong) NSString *gcmRegistrationToken; +@property(nonatomic, strong) NSArray *gcmTopics; @end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.m b/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.m index 90475d10..a176b9af 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.m +++ b/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.m @@ -27,9 +27,8 @@ #define GMP_NO_MODULES true #import "PushPlugin.h" -@import FirebaseInstanceID; -@import FirebaseMessaging; -@import FirebaseAnalytics; +#import "GoogleCloudMessaging.h" +#import "GGLInstanceIDHeaders.h" @implementation PushPlugin : CDVPlugin @@ -43,62 +42,78 @@ @synthesize clearBadge; @synthesize handlerObj; -@synthesize usesFCM; -@synthesize fcmSandbox; -@synthesize fcmSenderId; -@synthesize fcmRegistrationOptions; -@synthesize fcmRegistrationToken; -@synthesize fcmTopics; +@synthesize usesGCM; +@synthesize gcmSandbox; +@synthesize gcmSenderId; +@synthesize gcmRegistrationOptions; +@synthesize gcmRegistrationHandler; +@synthesize gcmRegistrationToken; +@synthesize gcmTopics; --(void)initRegistration; +-(void)initGCMRegistrationHandler; { - NSString * registrationToken = [[FIRInstanceID instanceID] token]; + __weak __block PushPlugin *weakSelf = self; + gcmRegistrationHandler = ^(NSString *registrationToken, NSError *error){ + if (registrationToken != nil) { + NSLog(@"GCM Registration Token: %@", registrationToken); + [weakSelf setGcmRegistrationToken: registrationToken]; - if (registrationToken != nil) { - NSLog(@"FCM Registration Token: %@", registrationToken); - [self setFcmRegistrationToken: registrationToken]; - - id topics = [self fcmTopics]; - if (topics != nil) { - for (NSString *topic in topics) { - NSLog(@"subscribe to topic: %@", topic); - id pubSub = [FIRMessaging messaging]; - [pubSub subscribeToTopic:topic]; + id topics = [weakSelf gcmTopics]; + if (topics != nil) { + for (NSString *topic in topics) { + NSLog(@"subscribe from topic: %@", topic); + id pubSub = [GCMPubSub sharedInstance]; + [pubSub subscribeWithToken: [weakSelf gcmRegistrationToken] + topic:[NSString stringWithFormat:@"/topics/%@", topic] + options:nil + handler:^void(NSError *error) { + if (error) { + if (error.code == 3001) { + NSLog(@"Already subscribed to %@", topic); + } else { + NSLog(@"Failed to subscribe to topic %@: %@", topic, error); + } + } + else { + NSLog(@"Successfully subscribe to topic %@", topic); + } + }]; + } } - } - - [self registerWithToken:registrationToken]; - } else { - NSLog(@"FCM token is null"); - } + [weakSelf registerWithToken:registrationToken]; + } else { + NSLog(@"Registration to GCM failed with error: %@", error.localizedDescription); + [weakSelf failWithMessage:self.callbackId withMsg:@"" withError:error]; + } + }; } -// FCM refresh token +// GCM refresh token // Unclear how this is testable under normal circumstances - (void)onTokenRefresh { #if !TARGET_IPHONE_SIMULATOR // A rotation of the registration tokens is happening, so the app needs to request a new token. - NSLog(@"The FCM registration token needs to be changed."); - [[FIRInstanceID instanceID] token]; - [self initRegistration]; + NSLog(@"The GCM registration token needs to be changed."); + [[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:[self gcmSenderId] + scope:kGGLInstanceIDScopeGCM + options:[self gcmRegistrationOptions] + handler:[self gcmRegistrationHandler]]; #endif } -// contains error info -- (void)sendDataMessageFailure:(NSNotification *)notification { - NSLog(@"sendDataMessageFailure"); -} -- (void)sendDataMessageSuccess:(NSNotification *)notification { - NSLog(@"sendDataMessageSuccess"); -} - -- (void)didSendDataMessageWithID:messageID { - NSLog(@"didSendDataMessageWithID"); +- (void)willSendDataMessageWithID:(NSString *)messageID error:(NSError *)error { + NSLog(@"willSendDataMessageWithID"); + if (error) { + // Failed to send the message. + } else { + // Will send message, you can save the messageID to track the message + } } -- (void)willSendDataMessageWithID:messageID error:error { +- (void)didSendDataMessageWithID:(NSString *)messageID { NSLog(@"willSendDataMessageWithID"); + // Did successfully send message identified by messageID } - (void)didDeleteMessagesOnServer { @@ -113,10 +128,20 @@ NSArray* topics = [command argumentAtIndex:0]; if (topics != nil) { - id pubSub = [FIRMessaging messaging]; + id pubSub = [GCMPubSub sharedInstance]; for (NSString *topic in topics) { NSLog(@"unsubscribe from topic: %@", topic); - [pubSub unsubscribeFromTopic:topic]; + [pubSub unsubscribeWithToken: [self gcmRegistrationToken] + topic:[NSString stringWithFormat:@"/topics/%@", topic] + options:nil + handler:^void(NSError *error) { + if (error) { + NSLog(@"Failed to unsubscribe from topic %@: %@", topic, error); + } + else { + NSLog(@"Successfully unsubscribe from topic %@", topic); + } + }]; } } else { [[UIApplication sharedApplication] unregisterForRemoteNotifications]; @@ -130,10 +155,25 @@ if (topic != nil) { NSLog(@"subscribe from topic: %@", topic); - id pubSub = [FIRMessaging messaging]; - [pubSub subscribeToTopic:topic]; - NSLog(@"Successfully subscribe to topic %@", topic); - [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully subscribe to topic %@", topic]]; + id pubSub = [GCMPubSub sharedInstance]; + [pubSub subscribeWithToken: [self gcmRegistrationToken] + topic:[NSString stringWithFormat:@"/topics/%@", topic] + options:nil + handler:^void(NSError *error) { + if (error) { + if (error.code == 3001) { + NSLog(@"Already subscribed to %@", topic); + [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Already subscribed to %@", topic]]; + } else { + NSLog(@"Failed to subscribe to topic %@: %@", topic, error); + [self failWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Failed to subscribe to topic %@", topic] withError:error]; + } + } + else { + NSLog(@"Successfully subscribe to topic %@", topic); + [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully subscribe to topic %@", topic]]; + } + }]; } else { NSLog(@"There is no topic to subscribe"); [self successWithMessage:command.callbackId withMsg:@"There is no topic to subscribe"]; @@ -146,10 +186,19 @@ if (topic != nil) { NSLog(@"unsubscribe from topic: %@", topic); - id pubSub = [FIRMessaging messaging]; - [pubSub unsubscribeFromTopic:topic]; - NSLog(@"Successfully unsubscribe from topic %@", topic); - [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully unsubscribe from topic %@", topic]]; + id pubSub = [GCMPubSub sharedInstance]; + [pubSub unsubscribeWithToken: [self gcmRegistrationToken] + topic:[NSString stringWithFormat:@"/topics/%@", topic] + options:nil + handler:^void(NSError *error) { + if (error) { + NSLog(@"Failed to unsubscribe to topic %@: %@", topic, error); + [self failWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Failed to unsubscribe to topic %@", topic] withError:error]; + } else { + NSLog(@"Successfully unsubscribe to topic %@", topic); + [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully unsubscribe to topic %@", topic]]; + } + }]; } else { NSLog(@"There is no topic to unsubscribe"); [self successWithMessage:command.callbackId withMsg:@"There is no topic to unsubscribe"]; @@ -158,22 +207,6 @@ - (void)init:(CDVInvokedUrlCommand*)command; { - [[NSNotificationCenter defaultCenter] - addObserver:self selector:@selector(onTokenRefresh) - name:kFIRInstanceIDTokenRefreshNotification object:nil]; - - [[NSNotificationCenter defaultCenter] - addObserver:self selector:@selector(sendDataMessageFailure:) - name:FIRMessagingSendErrorNotification object:nil]; - - [[NSNotificationCenter defaultCenter] - addObserver:self selector:@selector(sendDataMessageSuccess:) - name:FIRMessagingSendSuccessNotification object:nil]; - - [[NSNotificationCenter defaultCenter] - addObserver:self selector:@selector(didDeleteMessagesOnServer) - name:FIRMessagingMessagesDeletedNotification object:nil]; - [self.commandDelegate runInBackground:^ { NSLog(@"Push Plugin register called"); @@ -182,10 +215,13 @@ NSMutableDictionary* options = [command.arguments objectAtIndex:0]; NSMutableDictionary* iosOptions = [options objectForKey:@"ios"]; - NSArray* topics = [iosOptions objectForKey:@"topics"]; - [self setFcmTopics:topics]; + NSArray* topics = [iosOptions objectForKey:@"topics"]; + [self setGcmTopics:topics]; +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UIUserNotificationType UserNotificationTypes = UIUserNotificationTypeNone; +#endif + UIRemoteNotificationType notificationTypes = UIRemoteNotificationTypeNone; id badgeArg = [iosOptions objectForKey:@"badge"]; id soundArg = [iosOptions objectForKey:@"sound"]; @@ -194,20 +230,32 @@ if (([badgeArg isKindOfClass:[NSString class]] && [badgeArg isEqualToString:@"true"]) || [badgeArg boolValue]) { + notificationTypes |= UIRemoteNotificationTypeBadge; +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationTypeBadge; +#endif } if (([soundArg isKindOfClass:[NSString class]] && [soundArg isEqualToString:@"true"]) || [soundArg boolValue]) { + notificationTypes |= UIRemoteNotificationTypeSound; +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationTypeSound; +#endif } if (([alertArg isKindOfClass:[NSString class]] && [alertArg isEqualToString:@"true"]) || [alertArg boolValue]) { + notificationTypes |= UIRemoteNotificationTypeAlert; +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationTypeAlert; +#endif } + notificationTypes |= UIRemoteNotificationTypeNewsstandContentAvailability; +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationActivationModeBackground; +#endif if (clearBadgeArg == nil || ([clearBadgeArg isKindOfClass:[NSString class]] && [clearBadgeArg isEqualToString:@"false"]) || ![clearBadgeArg boolValue]) { NSLog(@"PushPlugin.register: setting badge to false"); @@ -219,8 +267,12 @@ } NSLog(@"PushPlugin.register: clear badge is set to %d", clearBadge); + if (notificationTypes == UIRemoteNotificationTypeNone) + NSLog(@"PushPlugin.register: Push notification type is set to none"); + isInline = NO; +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 NSLog(@"PushPlugin.register: better button setup"); // setup action buttons NSMutableSet *categories = [[NSMutableSet alloc] init]; @@ -277,46 +329,45 @@ } } +#else + NSLog(@"PushPlugin.register: action buttons only supported on iOS8 and above"); +#endif + +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 if ([[UIApplication sharedApplication]respondsToSelector:@selector(registerUserNotificationSettings:)]) { UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UserNotificationTypes categories:categories]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; [[UIApplication sharedApplication] registerForRemoteNotifications]; + } else { + [[UIApplication sharedApplication] registerForRemoteNotificationTypes: + (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; } - - // Read GoogleService-Info.plist - NSString *path = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"]; - - // Load the file content and read the data into arrays - NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path]; - fcmSenderId = [dict objectForKey:@"GCM_SENDER_ID"]; - BOOL isGcmEnabled = [[dict valueForKey:@"IS_GCM_ENABLED"] boolValue]; - - NSLog(@"FCM Sender ID %@", fcmSenderId); +#else + [[UIApplication sharedApplication] registerForRemoteNotificationTypes: + (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; +#endif // GCM options - [self setFcmSenderId: fcmSenderId]; - if(isGcmEnabled && [[self fcmSenderId] length] > 0) { - NSLog(@"Using FCM Notification"); - [self setUsesFCM: YES]; - dispatch_async(dispatch_get_main_queue(), ^{ - if([FIRApp defaultApp] == nil) - [FIRApp configure]; - [self initRegistration]; - }); + [self setGcmSenderId: [iosOptions objectForKey:@"senderID"]]; + NSLog(@"GCM Sender ID %@", gcmSenderId); + if([[self gcmSenderId] length] > 0) { + NSLog(@"Using GCM Notification"); + [self setUsesGCM: YES]; + [self initGCMRegistrationHandler]; } else { NSLog(@"Using APNS Notification"); - [self setUsesFCM:NO]; + [self setUsesGCM:NO]; } - id fcmSandboxArg = [iosOptions objectForKey:@"fcmSandbox"]; + id gcmSandBoxArg = [iosOptions objectForKey:@"gcmSandbox"]; - [self setFcmSandbox:@NO]; - if ([self usesFCM] && - (([fcmSandboxArg isKindOfClass:[NSString class]] && [fcmSandboxArg isEqualToString:@"true"]) || - [fcmSandboxArg boolValue])) + [self setGcmSandbox:@NO]; + if ([self usesGCM] && + (([gcmSandBoxArg isKindOfClass:[NSString class]] && [gcmSandBoxArg isEqualToString:@"true"]) || + [gcmSandBoxArg boolValue])) { - NSLog(@"Using FCM Sandbox"); - [self setFcmSandbox:@YES]; + NSLog(@"Using GCM Sandbox"); + [self setGcmSandbox:@YES]; } if (notificationMessage) { // if there is a pending startup notification @@ -371,8 +422,14 @@ [results setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"appVersion"]; // Check what Notifications the user has turned on. We registered for all three, but they may have manually disabled some or all of them. +#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) - NSUInteger rntypes = [[[UIApplication sharedApplication] currentUserNotificationSettings] types]; + NSUInteger rntypes; + if (!SYSTEM_VERSION_LESS_THAN(@"8.0")) { + rntypes = [[[UIApplication sharedApplication] currentUserNotificationSettings] types]; + } else { + rntypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; + } // Set the defaults to disabled unless we find otherwise... NSString *pushBadge = @"disabled"; @@ -383,13 +440,13 @@ // one is actually disabled. So we are literally checking to see if rnTypes matches what is turned on, instead of by number. The "tricky" part is that the // single notification types will only match if they are the ONLY one enabled. Likewise, when we are checking for a pair of notifications, it will only be // true if those two notifications are on. This is why the code is written this way - if(rntypes & UIUserNotificationTypeBadge){ + if(rntypes & UIRemoteNotificationTypeBadge){ pushBadge = @"enabled"; } - if(rntypes & UIUserNotificationTypeAlert) { + if(rntypes & UIRemoteNotificationTypeAlert) { pushAlert = @"enabled"; } - if(rntypes & UIUserNotificationTypeSound) { + if(rntypes & UIRemoteNotificationTypeSound) { pushSound = @"enabled"; } @@ -403,7 +460,24 @@ [results setValue:dev.model forKey:@"deviceModel"]; [results setValue:dev.systemVersion forKey:@"deviceSystemVersion"]; - if(![self usesFCM]) { + if([self usesGCM]) { + GGLInstanceIDConfig *instanceIDConfig = [GGLInstanceIDConfig defaultConfig]; + instanceIDConfig.delegate = self; + [[GGLInstanceID sharedInstance] startWithConfig:instanceIDConfig]; + + [self setGcmRegistrationOptions: @{kGGLInstanceIDRegisterAPNSOption:deviceToken, + kGGLInstanceIDAPNSServerTypeSandboxOption:[self gcmSandbox]}]; + + [[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:[self gcmSenderId] + scope:kGGLInstanceIDScopeGCM + options:[self gcmRegistrationOptions] + handler:[self gcmRegistrationHandler]]; + + GCMConfig *gcmConfig = [GCMConfig defaultConfig]; + gcmConfig.receiverDelegate = self; + [[GCMService sharedInstance] startWithConfig:gcmConfig]; + + } else { [self registerWithToken: token]; } #endif @@ -536,36 +610,31 @@ [self.commandDelegate sendPluginResult:commandResult callbackId:command.callbackId]; } --(void)successWithMessage:(NSString *)myCallbackId withMsg:(NSString *)message +-(void)successWithMessage:(NSString *)callbackId withMsg:(NSString *)message { - if (myCallbackId != nil) + if (callbackId != nil) { CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message]; - [self.commandDelegate sendPluginResult:commandResult callbackId:myCallbackId]; + [self.commandDelegate sendPluginResult:commandResult callbackId:callbackId]; } } -(void)registerWithToken:(NSString*)token; { // Send result to trigger 'registration' event but keep callback - NSMutableDictionary* message = [NSMutableDictionary dictionaryWithCapacity:2]; + NSMutableDictionary* message = [NSMutableDictionary dictionaryWithCapacity:1]; [message setObject:token forKey:@"registrationId"]; - if ([self usesFCM]) { - [message setObject:@"FCM" forKey:@"registrationType"]; - } else { - [message setObject:@"APNS" forKey:@"registrationType"]; - } CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:message]; [pluginResult setKeepCallbackAsBool:YES]; [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId]; } --(void)failWithMessage:(NSString *)myCallbackId withMsg:(NSString *)message withError:(NSError *)error +-(void)failWithMessage:(NSString *)callbackId withMsg:(NSString *)message withError:(NSError *)error { NSString *errorMessage = (error) ? [NSString stringWithFormat:@"%@ - %@", message, [error localizedDescription]] : message; CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:errorMessage]; - [self.commandDelegate sendPluginResult:commandResult callbackId:myCallbackId]; + [self.commandDelegate sendPluginResult:commandResult callbackId:callbackId]; } -(void) finish:(CDVInvokedUrlCommand*)command diff --git a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist index 7587f3bb..bc255035 100644 --- a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist +++ b/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist @@ -21,52 +21,58 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>0.9.1</string> + <string>0.9.2</string> <key>CFBundleSignature</key> <string>????</string> - <key>CFBundleURLTypes</key> - <array> - <dict> - <key>CFBundleURLSchemes</key> - <array> - <string>stoneisland</string> - </array> - </dict> - </array> <key>CFBundleVersion</key> - <string>0.9.1</string> + <string>0.9.2</string> <key>LSRequiresIPhoneOS</key> <true/> - <key>NSAppTransportSecurity</key> - <dict> - <key>NSAllowsArbitraryLoads</key> - <true/> - </dict> - <key>NSLocationWhenInUseUsageDescription</key> - <string/> <key>NSMainNibFile</key> <string/> <key>NSMainNibFile~ipad</key> <string/> - <key>UIBackgroundModes</key> + <key>UISupportedInterfaceOrientations</key> <array> - <string>remote-notification</string> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> </array> - <key>UIInterfaceOrientation</key> + <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> </array> <key>UIRequiresFullScreen</key> <true/> - <key>UISupportedInterfaceOrientations</key> + <key>NSAppTransportSecurity</key> + <dict> + <key>NSAllowsArbitraryLoads</key> + <true/> + </dict> + <key>UIInterfaceOrientation</key> <array> <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationPortraitUpsideDown</string> </array> - <key>UISupportedInterfaceOrientations~ipad</key> + <key>UILaunchStoryboardName</key> + <string>CDVLaunchScreen</string> + <key>CFBundleURLTypes</key> <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationPortraitUpsideDown</string> + <dict> + <key>CFBundleURLSchemes</key> + <array> + <string>stoneisland</string> + </array> + </dict> + </array> + <key>NSLocationWhenInUseUsageDescription</key> + <string/> + <key>UIBackgroundModes</key> + <array> + <string>remote-notification</string> </array> + <key>GCM_SENDER_ID</key> + <string>85075801930</string> + <key>IS_GCM_ENABLED</key> + <true/> </dict> </plist>
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island/config.xml b/StoneIsland/platforms/ios/Stone Island/config.xml index 92ab2f21..391e10e2 100755 --- a/StoneIsland/platforms/ios/Stone Island/config.xml +++ b/StoneIsland/platforms/ios/Stone Island/config.xml @@ -1,8 +1,12 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-versionCode="6091" id="us.okfoc.stoneisland" version="0.9.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-versionCode="6092" id="us.okfoc.stoneisland" version="0.9.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <feature name="LocalStorage"> <param name="ios-package" value="CDVLocalStorage" /> </feature> + <feature name="Console"> + <param name="ios-package" value="CDVLogger" /> + <param name="onload" value="true" /> + </feature> <feature name="HandleOpenUrl"> <param name="ios-package" value="CDVHandleOpenURL" /> <param name="onload" value="true" /> @@ -15,9 +19,6 @@ <param name="ios-package" value="CDVGestureHandler" /> <param name="onload" value="true" /> </feature> - <feature name="Console"> - <param name="ios-package" value="CDVLogger" /> - </feature> <feature name="Device"> <param name="ios-package" value="CDVDevice" /> </feature> @@ -51,15 +52,12 @@ <feature name="PushNotification"> <param name="ios-package" value="PushPlugin" /> </feature> - <feature name="CDVWKWebViewEngine"> - <param name="ios-package" value="CDVWKWebViewEngine" /> - </feature> <name>Stone Island</name> <description> Stone Island </description> <author email="julescarbon@gmail.com" href="http://asdf.us/"> - Jules Laplace + Jules LaPlace </author> <content src="index.html" /> <access origin="*" /> @@ -71,6 +69,16 @@ <allow-intent href="geo:*" /> <allow-intent href="itms:*" /> <allow-intent href="itms-apps:*" /> + <splash src="res/screen/ios/Default@2x~universal~anyany.png" /> + <splash height="480" src="res/screen/ios/Default~iphone.png" width="320" /> + <splash height="960" src="res/screen/ios/Default@2x~iphone.png" width="640" /> + <splash height="1024" src="res/screen/ios/Default-Portrait~ipad.png" width="768" /> + <splash height="2048" src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" /> + <splash height="768" src="res/screen/ios/Default-Landscape~ipad.png" width="1024" /> + <splash height="1536" src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" /> + <splash height="1136" src="res/screen/ios/Default-568h@2x~iphone.png" width="640" /> + <splash height="1334" src="res/screen/ios/Default-667h.png" width="750" /> + <splash height="2208" src="res/screen/ios/Default-736h.png" width="1242" /> <preference name="AllowInlineMediaPlayback" value="true" /> <preference name="BackupWebStorage" value="local" /> <preference name="DisallowOverscroll" value="true" /> @@ -86,12 +94,11 @@ <preference name="PaginationMode" value="unpaginated" /> <preference name="StatusBarOverlaysWebView" value="false" /> <preference name="StatusBarStyle" value="default" /> - <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" /> <preference name="TopActivityIndicator" value="white" /> <preference name="HideKeyboardFormAccessoryBar" value="false" /> <preference name="orientation" value="portrait" /> <preference name="StatusBarBackgroundColor" value="#ffffff" /> <preference name="SplashMaintainAspectRatio" value="true" /> <preference name="ShowSplashScreenSpinner" value="false" /> - <preference name="AutoHideSplashScreen" value="false" /> + <preference name="AutoHideSplashScreen" value="true" /> </widget> |
