How to show currently playing audio on Android with audio_service? - flutter

I've been using this package for couple of apps already. Always used one-isolate version.
On the iOS, I see this package successfully registers the audio on control center but on Android, I don't see control buttons anymore. Only a notification about that app being running on the background. Did I miss something in the setup or is it a bug?

When I'm initiating the service, I was overriding the androidNotificationIcon with an incorrect value.
androidNotificationIcon: 'mipmap/launcher_icon'
Probably because I've copied pasted some code from my previous application. I removed this line now and it points to the its default value.
{String androidNotificationIcon = 'mipmap/ic_launcher'}
Everything works.

Related

how to control camera retake in ziggeo for Ionic 3 framework

How to control the camera retake in Ziggeo for Ionic3. Ziggeo is taking the user to the camera and according to the device option, their user can take a lot of retakes. is it possible to stop the camera retakes or user may reflect back to ionic app as soon as user take video (Stop recording button).
I tried to found this on Ziggeo documentation but didn't got succeed.
Let me first mention that I work at Ziggeo. Now with that being said, lets get cracking :)
When camera is requested on the desktop systems the browsers talk to OS and OS talks to the drivers. The drivers talk with the camera and provide the video data. On the mobile devices this is slightly different.
The mobile browser will ask the system, which will reply by activating the camera app. The camera app is different for different versions of system and system itself, however in general they refuse to listen for any parameters that are sent to them from browser.
This is why you might see the option to retake the recording on the mobile devices.
The purpose of Ziggeo is to however provide a way to use camera and mic in many ways. As such there is a way to actually skip the native app and go to a new way of recording videos.
This is accomplished by adding the webrtc_on_mobile parameter when you are creating your app.
var ziggeoApp = new ZiggeoApi.V2.Application({
token:"APPLICATION_TOKEN",
webrtc_streaming_if_necessary: true,
webrtc_on_mobile: true
});
Now the above is just the HTML version of it. The Ionic is a bit different. Currently it is not possible, however it will be possible in the next update.
Edit 2020:
To support iOS webrtc_streaming_if_necessary: true was created. This is because the WebRTC implementation of WebRTC on those systems is for streaming, not the standard WebRTC. By using it, you make sure that you are not using the WebRTC Streaming unless it is actually necessary to do so.
Added the way you would use it in the above code.
You can always check and find the latest on the header building page on Ziggeo here: https://ziggeo.com/docs/sdks/javascript/browser-integration/header

WKExtension.sharedExtension().openSystemURL() prompting when it shouldn't

I am developing an extension of an iPhone App for Apple Watch (written in Swift running WatchOS2.2, Xcode 7.3, testing on a physical device)
I am running into an issue where I expect no prompt/confirmation on the Apple Watch when calling the tel schema for the following function:
WKExtension.sharedExtension().openSystemURL(NSURL(string:"tel:1231231234"))
I am not calling the telprompt function as my understanding is that this is not supported directly by Apple however it seems to be behaving as if it is telprompt. Interestingly enough, telprompt doesn't work.
I am expecting this to directly call the phone number without the prompt on the Apple Watch, however it is first prompting the user displaying a Cancel button on the top left, the number in the middle of the screen, and a Call button at the bottom. This also doesn't appear to be picking up the localization on the system (french for example) so it is always displaying Cancel and Call in English.
Image of Cancel, Number, and Call being prompted when French in the system language
Has anyone else encountered this issue? I haven't found much talk about it on the web. Or is this a known issues? Again, I don't see any bugs reported for it.
Fix Found for the Localization - See Below
Interestingly enough I was able to get the localization working.
The fix for it was that my Target for my Watch and WatchExtension needed to be checked off for my Launch Images (or splash screen images, or commonly left as "default.png"). Previously my Launch Images were for the app Target only.
I have no idea why the localization seemed to be require my launch images be added to the Watch and WatchExtension targets.
This did not resolve the prompting as it still took place - however since it was at least presenting the correct language this was good for us.

Is it possible to activate ionic app on call

I am not sure it is possible in ionic or not. What i want to do is create an app that can record user calls. so app must be activate when user make or get a call.
can anyone tell me if it is possible, how to do this?
Beware this won't be an easy task but "never give up, never surrender". You'll want to use a variation of techniques first off this isn't an Ionic thing as much as it is a PhoneGap thing - ionic runs on phonegap.
Your workflow will look something like this:
User opens your app sees a list of contacts
(the formatted names of contacts are different for android & ios so be prepared to test for this.
http://ngcordova.com/docs/plugins/contacts/)
Contacts are displayed in ion-list user select one and phone's dialer launches (use href=tel:xxxxx)
From there you're going to want to trigger the audio capture plugin's API
https://github.com/apache/cordova-plugin-media-capture
To add the plugin to your project:
cordova plugin add cordova-plugin-media-capture
While it doesn't directly say it can record in call conversations it should still work.
It can definitely be done the storage space is also of concern, you'll have to set something in place to tell the user how many seconds/minutes they have the capacity to store.
That should get you started there will certainly be unforeseen nuances.
Good luck.
We can record calls with cordova-media-plugin plugin in android.
First install the media Plugin by executing the following command
cordova plugin add cordova-plugin-media
Then goto the Plugin folder and traverse into the following file “plugins\cordova-plugin-media\src\android\AudioPlayer.java” . Here in the startRecording function we have line
this.recorder.setAudioSource(MediaRecorder.AudioSource.MIC); line number is 154
Change it to this.recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
We can replace MIC with any audio source in the following link. for example VOICE_COMMUNICATION,VOICE_DOWNLINK,VOICE_RECOGNITION etc
https://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html

Trigger.io: forge.file.getImage() causes an application crash when accessing Android's Photo Library

We have a serious problem in our application. Before, when we get an Image using camera or via Photo Library, our application crashed and restarts and become a blocker in our development.
W Forge : Unhandled intent result, should have been handled by Forge.
We tried the solution here: Trigger.io: : Unhandled intent result
And luckily, it won't crash now if we will use the camera. But the problem still exists when the user chooses Gallery.
Do we have any alternative way how to handle this kind of situation?
Waiting for any responses, thanks!!!
Not really at the moment - the device is running low on memory and your app is being killed when the gallery starts up.
One option would be to use a plugin / module like this, which presents the image-picking interface inside your app.
That plugin I linked to, however, is pretty old and made for Trigger.io version 1.4: it will take a bit of work to convert to a module.

Chrome Packaged App and Dual Monitors

I am working on a packaged app that will use multiple displays. I need to be able to open windows in specific displays. I've also tried opening windows and then, using javascript, moving them to a monitor. But the app will not move any further than the bounds of the active display.
Any ideas on how to get this to work?
Use chrome.system.display.getInfo with this you can get the display info for each active display.
With displayInfo.workArea you can get the working area of each display, you just have to think of one big display and each display is a workArea. With this information you can move your window with
AppWindow#setBounds to the correct monitor. Be carfull, AppWindow#moveTo is not working.
Use AppWindow#setBounds
E.g.
chrome.app.window.get('mainWindow').setBounds({"height": 200, "left": 2000})
Tested on v34
Boom. Change this to correct answer.
This was not the solution I was hoping for but as one of the comments mentioned there is a bug with Chrome and multiple monitors. In my case this is an internal application so I'm able to install anything i need to make this work.
My solution was to create a console application which launches the chrome app and then moves the windows around using the Windows32 API. Obviously not ideal but it works and the user still just needs one click to launch the app.
You can write a chrome extension to get this done. In the Background script you can listen to chrome.windows.onCreated event and use chrome.windows.update function to move the windows to other monitors