From 872f4620dc52c82b039e1a07a89836147b6870a7 Mon Sep 17 00:00:00 2001 From: EddyVerbruggen Date: Wed, 14 Oct 2015 21:43:44 +0200 Subject: [PATCH] #1 onHomeIconPressed when app was terminated --- README.md | 7 ++++++- package.json | 2 +- plugin.xml | 2 +- src/ios/app/AppDelegate+threedeetouch.m | 2 +- src/ios/app/ThreeDeeTouch.m | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 515ac54..b459d6f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ by [Eddy Verbruggen](http://twitter.com/eddyverbruggen) 2. [Screenshots](#2-screenshots) 3. [Installation](#3-installation) 4. [Usage](#4-usage) +5. [Changelog](#5-changelog) ## 1. Description @@ -127,4 +128,8 @@ preview pops up (see the screenshot above). If you want to enable this feature, To disable the link preview feature again, do: ```js ThreeDeeTouch.disableLinkPreview(); -``` \ No newline at end of file +``` + +## 5. Changelog +1.0.1 Increased the timeouts a bit, so there is a better chance `onHomeIconPressed` gets called on coldstart. Thanks #1. +1.0.0 Initial release diff --git a/package.json b/package.json index bff625f..1cec3c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-3dtouch", - "version": "1.0.0", + "version": "1.0.1", "description": "Add Quick Actions to your Home Screen which can be triggered by 3D Touch. Also, you can enable Link Preview with this plugin. Supported on iPhone6S an up.", "cordova": { "id": "cordova-plugin-3dtouch", diff --git a/plugin.xml b/plugin.xml index bb01826..de0d41e 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ 3D Touch diff --git a/src/ios/app/AppDelegate+threedeetouch.m b/src/ios/app/AppDelegate+threedeetouch.m index bba3d26..cd37662 100644 --- a/src/ios/app/AppDelegate+threedeetouch.m +++ b/src/ios/app/AppDelegate+threedeetouch.m @@ -19,7 +19,7 @@ - (void) callJavascriptFunctionWhenAvailable:(NSString*)function { if (threeDeeTouch.initDone) { [threeDeeTouch.webView stringByEvaluatingJavaScriptFromString:function]; } else { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 25 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 100 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{ [self callJavascriptFunctionWhenAvailable:function]; }); } diff --git a/src/ios/app/ThreeDeeTouch.m b/src/ios/app/ThreeDeeTouch.m index 5bdcab6..9ddbe34 100644 --- a/src/ios/app/ThreeDeeTouch.m +++ b/src/ios/app/ThreeDeeTouch.m @@ -7,7 +7,7 @@ @implementation ThreeDeeTouch - (void)pluginInitialize { // make sure the app is awake - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 200 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 300 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{ self.initDone = YES; }); }