-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onHomeIconPressed pass nothing when app wasn't run previously #4
Comments
That should be supported by this plugin; a cold start should invoke that function. Are you sure the function is available as soon as the app starts? Perhaps sharing your project would help us figure it out. |
In this case maybe something wrong with my code, I'll try something different and share results, if this will not help I'll share my code. |
@OleksandrPoltavets Did you find a solution? I have the same problem |
@Jarvey feel free to share your project and I'll take a look. |
@EddyVerbruggen I open the project in xcode by typing meteor run ios-device. I run the app from xcode, then hit the home button to put the app in the background. After that I can force touch to open the quick action menu and select a menu item. The app resumes and successfully shows the alert dialog. Then double tap the home button and swipe close the app and try the same thing again. This time the alert does not appear. |
Thanks a lot @Maziar-Fotouhi, I love it when folks take the effort of providing a sample app to reproduce the problem. Because I was able to debug your projects I quickly saw what the problem was. I've never used Meteor, so I learned from your project that there is a two-step launch going on, where Meteor needs to do a lot of initialization after Available in the (now published) 1.3.3 version. |
Thanks @EddyVerbruggen . A new issue has surfaced though. |
That's expected as your app's JS logic will add those home actions and your JS hasn't run before your app is launched for the first time. That's why I added the chapter 'Static Home Icon Actions' to the readme, I hope that helps. |
@EddyVerbruggen I think it should be working, since when we install the app with xcode, it does launch the app too, and we are initiating the quick action menu on "onDeviceReady". I did revert to the previous version (1.3.2) and it is working from the first run. Thanks again. |
@Maziar-Fotouhi When you run it from Xcode the apps runs immediately. That's not the same as when installing it from the AppStore (where it doesn't immediately run). So I'm not sure we're on the same page here. |
@EddyVerbruggen Thank you for all the great work and cool plugins. It would be nice to be able to set either of these through a plugin method call. |
Thanks! So your app now has 5 seconds to get ready. I don't want to overcomplicate things so rather not expose it. But would 10 or 15 secs suffice? |
Of course. It makes sense. 10 or 15 should be more than enough. If it doesn't work with 15 sec timeout, then I can be sure that it is not the onDeviceReady. Thanks a lot. |
…15 secs of waiting for the JS function to exist before telling the plugin to invoke it if necessary
…15 secs of waiting for the JS function to exist before telling the plugin to invoke it if necessary
15 it is! 3.3.4 has just been released. |
I'm just posting this for all the people out there who are using this plugin with meteor. The quick action menu did not work with meteor on cold starts of the app (when the app is closed and you try to use one of the menu items to start it). But update 1.3.3 took care of it to some extent. With update 1.3.3 the plugin started working but it was not consistent and it still did not work sometimes. The problem was that onDeviceReady was triggered and it was capturing the menu button that was chosen, but, some of the other methods that I was using for these events (e.g. inAppBrowser), were not loaded yet. So this is what I ended up doing:
This will give other methods and plugins a little extra time to load before you can use them in the 3dtouch plugin. Thanks to @EddyVerbruggen and my genius colleague @mjwheatley who figured all of these out! |
Hello Maziar-Fotouhi, i'm trying this plugin in meteor I've tested this plugin on iPhone 6s (iOS ver.-9.2) and app was build with Xcode 7 as per the minimum requirements of this plugin to work, but when i'm checking the availability of the plugin, the following code returns me false, am i doing something wrong? ThreeDeeTouch.isAvailable(function (avail) { |
@array-addu, your comment from issue #11
This is not 100% accurate. Just to be safe you should use an onDeviceReady callback
In this case isAvailable() is true in both places as long as you are testing on a real device. It seems the emulator will always return false as this feature is not available on emulators. |
Ah ! It's working now. Thank you mjwheatley. One more thing i want to confirm, |
For this purpose it is necessary to prescribe ThreeDeeTouch.enableLinkPreview(); |
I'm using v1.3.7 with ionic and I have the similar problem here. What's the suggestion to get the payload when the app wasn't run previously? I'm using it in
|
Hello, maybe it is not an issue and I missed something in plugin documentation but I have the following behaviour, when I run app and make it foreground I have 3D touch icons and all actions works good with pressing them but if I close app (unload it from memory), I have 3D icons but they just run my app from the default state and doesn't pass any 3D touch type events. Could someone please advice what I'm doing wrong or maybe it is not available in this plugin?
The text was updated successfully, but these errors were encountered: