简体   繁体   中英

Cordova: Hybrid iOS App Pause event doesn't get fired when making a phone call

Does the iOS app go to the background when we make the call using tel://123456789 ?

I have an iOS app that requires to log any outbound event happening through our app (like sending mail, calling, etc).

For Calling

we use some thing like : <a href="tel://123456789"></a>

in this case dialler opens up and makes the call but pause or resume events never gets triggered . So basically we dont have hook/event after the call was ended to make the log entry for call . Though while replicating the same flow on android proper events(resume, pause) gets fired.

For Mail

we use some thing like : <a href="mailto: test@test.com"></a>

in this case mail client of the user gets opened and our hybrid app goes to background and once mail is sent and the user returns to the app "resume" event gets fired

We need something similar for the phone call. Any pointers will be really appreciated.

You could try to listen to the click on the a tag then trigger that event yourself if it is not triggered by Cordova, that way you don't have to change your code. Using jQuery:

 $('your_a_tag').on('touchstart', function(event){
      $(document).trigger('pause');
 });

Alternatively, you could open a support ticket on cordova-ios repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM