Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Cordova Android App from Calendar

Hi I am using EddyVerbruggen/Calendar-PhoneGap-Plugin in my ionic app to save calendar events.

What I want to achieve is when I go my calendar and click on that event I want to open my app. How to do that?

like image 625
Aniket Avatar asked Nov 23 '15 07:11

Aniket


1 Answers

You won't be able to override calendar functionality to direct to your ionic application.You can only open your ionic app via custom links.

How to open ionic application using custom url?

Mobile applications made with Ionic Framework can leverage custom URL schemes by using a plugin LaunchMyApp

Add the plugin into our project.

cordova plugin add https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin.git --variable URL_SCHEME=ionicapp

Where the command --variable URL_SCHEME=ionicapp is essential otherwise the plugin will fail to add. Then you will be able to launch your application from any URL that starts like this:

ionicapp://

You could listen in your application for various URL paths and parameters and have your application do various things depending. Add the following code globally:

var handleOpenURL = function(url) {
    alert("RECEIVED URL: " + url);
};

Tutorial

like image 196
Muhsin Keloth Avatar answered Oct 21 '22 17:10

Muhsin Keloth