IonicDeepLinkPlugin doesn't fire deeplink event to JS - ionic2

I'm implementing deep-link in ionic, in Android works fine but in IOS don't send the url to the JS. The plugin is capable of opening the app but the function handleOpenURL is never called.
When I click over a link the debugger's log:
IonicDeepLinkPlugin: Handle continueUserActivity (internal)
https://www.example.com
My versions are:
Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.10.0
Xcode version: Xcode 8.3.2 Build version 8E2002
Am I doing something wrong? Any Idea?
Thanks in advance!

Related

Ionic 2 app takes too much time to load even build with --prod flag

Well, I am new to ionic 2 and build my first app having 2 pages and 2 services which are the very simple and for a news website.
The problem is, first I build my app for android using --release flag the file size was near 4MB and when I deploy on my mobile the load time was 14 - 17 seconds.
Then I search for 2 days to fix this issue and came up with the idea that I should enable production mode in main.ts and build using --prod flag . Now file size is 2.65MB and load time is 8 - 11 seconds which I think too much time for a mobile device. :(
My system information is:
ordova CLI: 6.5.0
Ionic Framework Version: 3.2.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.10.0
Xcode version: Not installed
In my app I simply pulling news from rest server and displaying on my page. Am I doing something wrong or is there any issue with new version of ionic? I also read by some people that ionic 1 speed was good than the latest version.
Note: I run my app on 3 different devices the issue remain the same.
Check your config.xml, and set SplashScreenDelay value to zero
<preference name="SplashScreenDelay" value="0"/>.
For me, below command worked:
ionic cordova build ios --prod --aot --minifyjs --minifycss --optimizejs
You can use your own platform in above command instead of ios.
It decreased app load time in my case.
Please find more details here https://forum.ionicframework.com/t/ionic-app-takes-too-long-to-start/97546

How to reduce Ionic2 app load time

I am currently developing an Ionic2 app.
My app has
- Total 29 Pages
My plugins are
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 4.3.2 "File"
cordova-plugin-file-transfer 1.6.2 "File Transfer"
cordova-plugin-network-information 1.3.2 "Network Information"
cordova-plugin-splashscreen 4.0.2 "Splashscreen"
cordova-plugin-statusbar 2.2.1 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
cordova-sqlite-storage 2.0.2 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
config.xml is almost default set.
I do npm run ionic:build --aot + ionic prepare android --prod --release, after that I create signed apk from android studio.
My app start time is 9-10 seconds.
How can I reduce it.
Please advice.
There is an ongoing discussion on the forums about this painfull issue
For now, the possible steps may help:
Hiding the splashscreen manually and disable autohide
Shrink the code with rollup, make sure to build for production
Adding lazy loading of some elements
Upgrading to newer ionic version 3+ which brings angular4

Native transfer plugin - not available after install in ionic2

I have installed native TRANSFER plugin in my ionic 2 app in 2 steps:
1. ionic plugin add cordova-plugin-file-transfer
2. npm install --save #ionic-native/transfer
After that i imported the plugin in my home.ts page.
Import { Transfer } from '#ionic-native/transfer'
I tried to use the plugin to upload a file
var ft = new Transfer();
But i can't use ft var, because Transfer plugin look like it's not avalable.
If i write ft.upload () i receive an error like: Property 'upload' does not exist on type 'Transfer'.
My technologies:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
In the previous version of my app when using Ionic Framework Version: 2.0.0-rc.5 /Ionic App Scripts Version: 1.0.0 all worked just fine.
Does anyone has any solution for this?
Thanks in advance.
In the 3.1.0 version of Ionic Native,
you have to use the plugin like a provider.
Import it in app.module.ts and set as provider
import {Transfer} from '#ionic-native/transfer'
#ngModule({
//...
providers:[
Transfer,
..]
Inject in the component/provider where you need to use it.
constructor(private fileTransfer:Transfer){}
Use the fileTransfer object.
Documentation: Ionic Native and Transfer

Ionic 2 Camera makes app crash

When i use the camera button that should launch the camera on my android device it gives me this error with chrome inspect:
file:///storage/emulated/0/Android/data/io.ionic.starter/cache/.Pic.jpg exposed beyond app through ClipData.Item.getUri()
I am clueless, can't find it anywere..
All help is appreciated!
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.12
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.45
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.1
Xcode version: Not installed
Passing in Width and Height solves the crashing issue for me.
const options: CameraOptions = {
quality: 100,
targetWidth: 100,
targetHeight: 100,
destinationType: Camera.DestinationType.DATA_URL,
encodingType: Camera.EncodingType.JPEG,
mediaType: Camera.MediaType.PICTURE
}
Camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64:
this.idImage = imageData;
this.idImageSelected = 'data:image/jpeg;base64,' + imageData;
}, (err) => {
// Handle error
});
}
got this solved updating cordova platform android to be 6.1.1 and then updating the camera plugin.
check your android cordova platform version:
cordova platform ls
if android is 6.0 < then you need to update it and add the updated version to your project, this should work:
cordova platform update android
but in my case it won't update the android platform version so I had to explicitly install 6.1.1
cordova platform add android#6.1.1 --save
then it updated to 6.1.1 and I then removed and added cordova camera plugin to my project:
cordova plugin remove cordova-plugin-camera --save
and then
cordova plugin add cordova-plugin-camera --save
an up to date cordova-plugin-camera was then installed and I could see it in my config.xml
I've deployed my app to device again ionic run android and it worked.
I do with this options : run well in Android device
doCamera() {
Camera.getPicture({
destinationType: Camera.DestinationType.FILE_URI,
saveToPhotoAlbum: true,
mediaType: Camera.MediaType.PICTURE,
}).then((imageURI) => {
this.changeImageString(imageURI);
}, (err) => {
console.log("Error: " + err);
});
}
see enter link description here
Ionic Info:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
Ionic App Scripts Version: 0.0.38
Node Version: v6.8.1

Why PWA ServiceWorker don’t work for me with Ionic 2?

I am having great difficulty in operating the ServiceWorker with ionic 2.
I start a new project with ionic this:
$ Ionic start pwa-project blank --v2
The default structure created by the ionic me two important folders:
- src
- www
In both there are the files:
- Index.html (where I have to uncomment the call to service-worker)
- Manifest.json (which set up the data from my app)
- Service-worker.js (the my service worker itself)
The logic for developers in ionc is not touching anything in the www folder and only work in the src folder. And I did, ran the $ ionic serve and started to edit my html, service-worker and manifest, all in the src folder. But I noticed that the changes are not reflected on the same files in the www folder.
Restarted the $ ionic serve and nothing happened.
All right, then I proceeded to edit these three files directly in the www folder to Activate from my service-worker.
This time I came across another problem. The service-worker does not run.
The script invokes the service-worker in the index.html file prints to the console the success message "service worker installed" confirming that it was installed, but I wrote some console.log() in my service-worker of events and these events are not fired, and I can not say why.
console.log ( '[SERVICE WORKER] Install');
console.log ( '[SERVICE WORKER] Activate');
console.log ( '[SERVICE WORKER] Fetch');
None of these is displayed on the console, which makes me believe that the service-worker for some reason, is not running.
In Chrome DevTools, Application pane, appears that the service-worker is installed and enabled.
Has anyone experienced this problem? Managed to solve?
PS .: When I create a project in vanilla javascript everything works fine, the service-worker is installed, running and messages are usually displayed on the console, which makes me believe that there is any interference Ionic (v2).
My Ionic info is:
Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
OS: Distributor ID: elementary OS Description: elementary OS Freya
Node Version: v5.12.0
Late to the party, but for my current setup, all is working fine:
cli packages: (/home/khophi/Developments/Ionic/KhophiPwa/node_modules)
#ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
local packages:
#ionic/app-scripts : 2.1.3
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.6.0
System:
Android SDK Tools : 26.0.2
Node : v7.10.1
npm : 4.2.0
OS : Linux 4.10