cordova-plugin-3dtouch
cordova-plugin-3dtouch copied to clipboard
Peek and pop functionality is not working with IONIC framework
Is anyone ever tried this plugin with IONIC native.
I tried the configure actions and it working perfectly fine.
When I try to integrate the enableLinkPreview() feature the app is not reacting and nothing is happening.
I initialized the enableLinkPreview() in configure action method.
Here is my code
function configure() {
// Check if 3D Touch is supported on the device
check3DTouchAvailability().then(function(available) {
if (available) { // Comment out this check if testing in simulator
// Configure Quick Actions
window.ThreeDeeTouch.configureQuickActions([
{
type: 'newNote',
title: 'New Note',
subtitle: '',
iconType: 'compose'
}
]);
// Set event handler to check which Quick Action was pressed
window.ThreeDeeTouch.onHomeIconPressed = function(payload) {
if (payload.type == 'newNote') {
$rootScope.$broadcast('newNoteQuickAction');
}
};
window.ThreeDeeTouch.enableLinkPreview(function (available) {
alert('enabled');
});
}
})
}
Thanks.
Any suggestions please.
@ankushgoyal27 I haven't implemented linkPreview but according to the docs, it doesnt work in all cases.
why are you passsing available
to the enableLinkPreview
callback?
the readme doesnt make it look like you need to pass a callback to enableLinkPreview. simply calling the function will enable the feature.
if you add <a href="https://www.google.com">Press hard to test 3D Touch</a>
to your template and try 3D Touching it on ios device which supports 3D Touch, what happens?
(might want to check that youre config.xml allow-intent will allow traffic to your linked website and index.html CSP allows traffic as well. I'm not a CSP expert but just check Xcode open and look at the console to see if you see anything like "navigation not allowed")