I have a nativescritp app, which receive phone calls.
When the app is not running on foreground, it still receives the calls, which is fine.
What I need to do is to "load" / "run" / "show" the application on the screen, so the user can answer the phone call or decline it.
It may not be quite straight forward as building an app and there are no ready made plugins available to achieve this.
For iOS you will have to implement CallKit and for Android you will have follow the set of procedures explained here.
FYI, with iOS your normal code won't run any longer if app is minimised. With Android you will have to implement the android.telecom.ConnectionService as explained in the link above, refer onShowIncomingCallUi() for showcasing UI for the call.
If you are not proficient with marshalling native code (iOS & Android) then I would suggest you to start there.
Related
does anyone have any idea how to make an app that automates and filter rideshare/restaurant apps requests? It's kinda working as an umbrella for more than one app.
for example, the XYZ app will be in the foreground and will monitor both Uber Eats and Postmate in the background and whenever requests are received it will show on the XYZ app screen with its details.
I believe it's not doable on the IOS but its existing on android on an app called Mystor. it uses somehow advisability functions in the phone but I want to understand the logic behind it and know how does it work?
I am working on an android app built on apache cordova. The app used to send your location via SMS, Email & in app notification to your predefined contacts. I want this sharing event to be triggered on double tapping on screen (when locked) or 3-4 times pressing the power button/ volume button.
Its for emergency situation, when user may not be able to unlock phone & open app to share any info.
I've searched a lot but could not find any relevant info. is there any available plugin to do that? I know very little of JAVA. Expecting any plugin that would allow me to launch the app(any activity) when phone is locked.
Any helpful information or suggestions are appreciated.
To accomplish this kind of task, you need to run a service in background, it is not possible to use any cordova webview, so you won't be able to run any javascript.
I don't think there is any plugin doing such a thing as it is very specialized.
I needed to create an app that needed to send notification to the user depending on his location. It ended up in writing a native plugin...
So the best advice I can give you is "It's never too late to learn Java" ;-)
maybe some other JS framework (maybe NativeScript) allows such things but I never used it yet so it might be impossible too.
I have an Android app (internal for my company, not public) developed using JQM and Phonegap.
The app check each 15 minutes if the company server have some news for the device (1 device = an employee).
But it only works if the device is not in sleep mode.
I would like at least be able to do the same as whatsapp and other apps, send a little message to the notification area and/or shows a little window, sounds a beep...
I can do some of this (as shows a window, sounds a beep) but only if the device is running in visible (not sleep) mode.
Then my question is:
How to have an android phonegap app that is always running, or at least run each x minutes?
I this is not possible... Is possible then create an "mini" real native app only for this purpose, thus "call" to my app each x minutes?
Thanks,
Guillermo, Spain.
link http://www.tipsfromsiliconvalley.com/2013/07/06/create-a-service-on-android-with-phonegap-application/
There is this article on how to create a service on Android with Phonegap which gives some good information on your problem.
It's using a great plugin in order to build a background service with phonegap easily. But you can't use JS though
I didn't find a way to make JS to run in the Background. BUT you can pass parameters from Java to JS and vice versa with the plugin...which is pretty useful. You would still need to rewrite your JS code in Java though.
you could create a service that calls a javascript callback? For example, you could have a service in Java code that when it receives a text message it calls a javascript callback function to execute some JS code? That would be perfect. plugin that seems to create a service and call Js code:
https://github.com/marknutter/GCM-Cordova
I am working on an app with PhoneGap on android where the user will get messages every now and then bringing them to one of the pages on the app. I've looked at a few possibilities but haven't found any simple way to do this. Can I use the built in Notification on the Phonegap API to do this?
I have found a few good ways to do push notifications like thisw: http://www.pushwoosh.com/programming-push-notification/android-push-notification-for-phonegap/ but I want the notification to be coming from the app itself with the time determined by a built in timer.
Thanks!
You can't, not in Phonegap anyway. If the user leaves the app with the Home button, then the code is still running (until it gets killed when memory gets low). But if the user exists with the back key, the app dies. See here: Creating an Android Service with Phonegap? (Have phonegap app run even when closed)
iOS 4.2+ allows certain webapps to run in the background, without any special requirements.
How is it possible to run a webapp in the background on Android (to continue playing music, for example)?
For an example, see https://coolaj86.com/demos/sandbox/html5-audio-tag.html
Begin playing the music sample on your iPod/iPad/iPhone, then click to "background" the app.
Double click and swipe from left to right in the lower menu to access the player controls.
That is done by using background Services.
As Robby said, to do this you need to use a Service.
Obviously you can't have a "background web page" just like you can't have one of those with any browser. The solution is to use WebView's setJavascriptInterface() to create an interface between your background service and HTML5/JS front-end in the WebView. With a javascript interface, you can create your own bindings to call into Java code from inside of your javascript.
The service can be used to preserve the background functionality, but when the app comes back into the foreground the WebView needs to bind to it via javascript interface again, get the data it needs, and populate its UI.
This is not really an answer, but wouldn't it be great though, if we could request a webpage to continue running in the background. Of course the page should need an explicit (and at all time revokable) consent from the user, but that doesn't seem like a completely impossible thing to handle for the (native) browsers? :( We already prompts the users for permission to use other APIs like the location API - why not also a run-as-a-service API?
It would be such a huge step forward for all webapps to be equal to native apps in my opinion! <3