Flutter based call recording app with native UI integration - android

I am trying to get call-recording to work with native UI integration using flutter, CallKit (iOS) and ConnectionService (Android).
Since there is no guide for integrating flutter with CallKit and ConnectionService or any other service to enable system-like call recording without root access or jailbreak, this question has come to existence.
There are a lot of apps available for jailbroken devices and android does natively support call recording, but there is no concrete guide for implementing the same using flutter.
Using flutter 1.7 with AndroidX support for back-compatibility of marshmallow+ ConnectionService.
The expected result is to automatically record calls or prompt user to do so whenever there is an incoming call.
Currently unable to do it at all, maybe I am missing something essential in the documentation or I don't have the sufficient know-how for the successful execution of creating a system-supported call-recording app using flutter.

Since there is no guide for integrating flutter with CallKit and ConnectionService ...
In short, mentioned via comments, you’ll have to refer to https://flutter.dev/docs/development/platform-integration/platform-channels to do it yourself by implementing platform-specific code such as CallKit/ConnectionService.
First, because there’s currently likely no Flutter library that has already conveniently packaged this up for you, at least not at https://pub.dev/flutter, so this is why you need to do it yourself.
Now, assuming all the restrictions, permissions, rooting, jailbreaking, etc. poses no issue to you, then you would need to implement these APIs natively in iOS/Android first, for example, Android:
#Override
public void onMethodCall(MethodCall call, Result result) {
if (call.method.equals("recordCall")) {
result.success(recordCall());
}
}
Which will then allow you to call them from Flutter:
_recordCall() {
var recording = await platform.invokeMethod('recordCall');
}
So don’t think of how to do this in Flutter, the above was the easy part.
Your perspective should be: how to do this on iOS/Android, because the magic is in recordCall()

Related

Firebase: Is mixing C++ and Java SDK ok?

Is it ok to use both the Java and the C++ version of Firebase SDK in one application?
For example I would like to use Crash Reporting to report non-fatal exceptions from Java code and use Remote Config from C++ code. Or in Analytics, I would like to log some events from C++ code and some other events from Java code.
The steps to setup C++ SDK basically include the steps to setup Java SDK, so one gets both either way. But I couldn't find any information whether it is really safe to use that way.
I use it this way. You just need to make sure that you aren't initializing the FIRApp more than once. If you init in your onCreate of your activity and never anywhere else then you should be alright. If you want to be able to init on the C++ side, then you need to check GetInstance() to make sure you aren't already running.
On the C++ side I will perform checks that the App is not null, e.g...
auto app = firebase::App::GetInstance();
if(app)
{
firebase::auth::Auth* auth = firebase::auth::Auth::GetAuth(app);
if(auth)
{
User* user = auth->current_user();
if(user)
{
if(user->is_email_verified() == false)
user->SendEmailVerification();
}
}
}

Android Native to React Native bridge

I've been searching on how to make a bridge between React Native and Android Native code for a while, but I still don't quite get it. I've read the documentation here , but I don't quite understand it.
What I want to do is, I want to build an apps that utilize push notification, but since I need to push message to China, I can't use GCM (thanks to the great firewall), so I use another third party push SDK.
I've managed to integrate the push into my apps (resulting a console.log() message whenever I push something), the next step is I want to re-route it to certain page
Any help will be appreciated :)
Note: If you are using common push notification (i.e. GCM and APNS), use this instead. Since I need to use another third party push service, I need to find a way myself to bridge the SDK (which is native) to React Native.
So after several hours tinkering with this problem, I found a solution for my problem. This solution divided into 2 parts:
emitter, this will emits an event whenever the server send a push.
listener, this will listen to the event that you emits before.
emitter
This happens on the native side (Android in my case)
For this part I learnt it from how this library did using GCM. And found a tutorial here on the RN documentation.
Basically after you receive your push on SomeBroadCastReceiver onReceive() function, you can pass the bundle as params in this function
reactContext
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
//this eventName is a key so you need to remember it, because you need to call it on the listener
.emit(eventName, params);
listener
The listener will be built on the RN side. this documentation helps me. I missed this documentation before, because it only appear in the RN iOS docs only.
import { NativeEventEmitter, NativeModules } from 'react-native';
//import your already created package name here
const { YourCustomPackageName} = NativeModules;
then in ComponentWillMount()
const yourCustomPackageEmitter = new NativeEventEmitter(YourCustomPackageName);
pushListenerEmitter.addListener(eventName, this.handlePush, this);
then you just need to create handlePush function and get the params there
handlePush = (event) => {
console.log('event triggered..');
console.log(event);
}
The best way to do push notification is Deep Linking. If you are using React Navigation its much simple to do. Deep Linking React Native
You can define unique URL like yorApp://employee/1 and navigate easily to that screen.

Attach to Like!andTweed function in cocos2d-x Android App

I created Android App that is made by cocos2d-x.
I'd like to implement cooperation function with social network service (facebook and twitter )
For example, Like! button which separate news feed.tweet function.
But This function turned out to be a can of worms which I couldn't finish.
I found EziSocial. but I can't find any hints.
would you give me a
description of how to use and method of attach to existing app
We have series of tutorials available on our website. http://ezibyte.com/tutorials/
Disclaimer: I am the creator of EziSocial Plugin

Auto Update of application using HockeyApp SDK

I am using Android HockeyAppSDK to deploy updates to an application. I am trying to use the docs to customise the default UpdateManager class to allow updates to be installed automatically, without prompting the user to accept the update.
I am quite unsure of how to handle this. The obvious way (in my mind anyway) is to do the following:
private void checkForUpdates () {
UpdateManager.register (this, Constants.HOCKEY_API_KEY, new UpdateManagerListener() {
public void onUpdateAvailable() {
//I assume stuff will need to be handled here
}
});
}
Has anyone done this before, or can find a way to do it?
Many thanks
After emailing the support team for Hockey, they believe that within their current compiled API it is not possible to perform an update without prompting users to accept.
The whole source would require modification and compilation before working as expected it seems.
You can use UpdateTask from library

CakePHP 2.0 and mobile application authentication

I'm going nuts over here! I've got a website I am making in CakePHP that will form the back end of a mobile application. It is not a mobile website, it's designed purely to be used for a smartphone application.
That being said: The application needs the user to login. But I just cannot seem to find the right way to implement this. The BasicAuthenticate AuthComponent seems to hate me and doesn't make debugging easy. There's an OAuth 2.0 Provider plugin for CakePHP 2.0, but I can't figure out how to make it 2 legged, as the app won't be relying on the website to display a login form.
I really need to figure out which of these paths to take and how to make it work but just neither one wants to work. Anybody have any info on what I need to do?
Update The Basic Auth issue turned out to be due to Virtualmin preferring to use FCGId to allow the process to run as the same owner as the content of the website. I have since switched it back to mod_php and it works fine.
So my question is now more about using cakephp-oauth-server in a 2 legged setup.
public function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('index','view');
$this->set('logged_in', $this->Auth->loggedIn());
$this->set('current_user',$this->Auth->user());
if($this->name == 'Specific') {
// for the specific controller
$this->Auth->authenticate = array('Basic');
} else {
// everything else
}
}
checkout KVZ's rest plugin it may be of interest https://github.com/kvz/cakephp-rest-plugin

Categories

Resources