Comments (16)
Will need to check this out and confirm your uid is infact stored and retrieve from shared preferences
Start looking here:
String fromId = activeCallInvite.getFrom().replace("client:", "");
SharedPreferences preferences = getApplicationContext().getSharedPreferences(TwilioPreferences, Context.MODE_PRIVATE);
String caller = preferences.getString(fromId, preferences.getString("defaultCaller", getString(R.string.unknown_caller)));
from twilio_voice.
@diegogarciar what do you have in mind to address this - do you want to stick with the registerClient()
function or add an addition for callerName
s implemented natively with optional clientImageUrl
s too. If so, this should be added in TwiML parameters received by the client(s).
I've got my own fork that will be implementing this approach, depends on if you wish to take this approach I can merge my changes then it can be used in cases such as this from @VictorPadovan1997 .
from twilio_voice.
@cybex-dev yes create a PR so I can have a closer look. Sorry I’ve been traveling for the week so I have been busy!
from twilio_voice.
I managed to solve this problem.
for those who have the same doubt:
I needed to make changes to the file AnswerJavaActivity.java.
https://github.com/diegogarciar/twilio_voice/blob/master/android/src/main/java/com/twilio/twilio_voice/AnswerJavaActivity.java#L149
for me everything is resolved when app is in the foreground and background.
I went as follows in the file:
String fromId = activeCallInvite.getFrom().replace("client:", "");
SharedPreferences preferences = getApplicationContext().getSharedPreferences(TwilioPreferences,Context.MODE_PRIVATE);
Log.e(TAG, "From id : "+fromId);
String caller = preferences.getString(fromId, preferences.getString("defaultCaller", getString(R.string.unknown_caller)));
Log.e(TAG, "Caller : "+caller);
tvUserName.setText(fromId.replace("_"," "));
full function:
private void configCallUI() {
Log.d(TAG, "configCallUI");
if (activeCallInvite != null) {
String fromId = activeCallInvite.getFrom().replace("client:", "");
SharedPreferences preferences = getApplicationContext().getSharedPreferences(TwilioPreferences, Context.MODE_PRIVATE);
Log.e(TAG, "From id : "+fromId);
String caller = preferences.getString(fromId, preferences.getString("defaultCaller", getString(R.string.unknown_caller)));
Log.e(TAG, "Caller : "+caller);
tvUserName.setText(fromId.replace("_"," "));
btnAnswer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG, "onCLick");
checkPermissionsAndAccept();
}
});
btnReject.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
rejectCallClickListener();
}
});
}
}
Result:
from twilio_voice.
@cybex-dev shouldn't this be a function handled by the package?
it shows me the identifier only after I "accept" the call
from twilio_voice.
@cybex-dev shouldn't this be a function handled by the package? it shows me the identifier only after I "accept" the call
You have a few options here.
- You can make use of custom parameters (see TwiML documentation here).
Please note: Their sample node project has an incorrect Twilio version reference of 4.6.*,, which doesn't exist. Make sure to use the latest version from NPM 3.71.1 (version as of writing this) - this is super important as their 4.6.* does not have a .parameter()
function. I need to submit a PR for this.
- You can access call information: Client from and call to via
TwilioVoice.instance.call.activeCall
, see active_call.dart for more info.
Please note: this information is only available once the CallEvent.ringing
has been fired.
from twilio_voice.
@cybex-dev Thank you for your help.
I made the first step
- use custom parameters on my server.
$client->parameter(['name' => 'displayName', 'value' => $displayName]);
After configured I noticed that it shows on my console now the displayName that I'm sending through extraOptions.
D/FlutterFcmService( 9721): Bundle data: {twi_account_sid=Axxxxxxxxxxxxxx, twi_params=displayName=Celular&FirstName=Celular,...............}
even so it doesn't show the identifier when it calls when it's in ringing.
Then I passed a breakpoint on the case CallEvent.ringing, and this is my return:
We can see that To and From is correctly arriving.
but he keeps showing me 'Unknown Caller' when he's only in ringing
I also noticed that the custom parameter is dropping in customParams correctly from the caller.
since everything is arriving correctly, as I specify to throw this information to the background screen when it's ringing
.
from twilio_voice.
amazing, we are waiting for the return of the @diegogarciar
from twilio_voice.
@cybex-dev As soon as you go up, let me know.
thnks.
from twilio_voice.
@ cybex-dev você adicionou o PR?
from twilio_voice.
Any solution ?
keeps appearing to me unknown.
from twilio_voice.
It's been far too long - will be adding in upcoming update.
iOS, Android & Web.
from twilio_voice.
@VictorPadovan1997 This should no longer be a problem in the next release (not the upcoming one), however thank you for your suggestion - I'll implement your suggested fix.
from twilio_voice.
Check out #151 merged
from twilio_voice.
See release 0.1.0
from twilio_voice.
A few years ago, today doesn't help in nothing 👎🏻
from twilio_voice.
Related Issues (20)
- Receiving incoming call even after logout from the app - IOS
- Native Call Screen UI on iOS
- TwilioVoice.instance.callEventsListener is not called in incomming call android Flutter HOT 2
- How to terminate Native Call Ui When Create Make Call
- Native Ui Accept and Decline Button Not Work
- In Android App is not working in release mode but wotking fine in dubug mode HOT 2
- Unregistering a Twilio instance does not end active calls on it. HOT 1
- [Android] Can't run project in flutter 3.19.0 HOT 7
- customParams field in Active Call is null on Answer event.
- [Question] Is Windows platform supported? HOT 3
- [iOS] Poor call quality on iOS with a lot of jittery HOT 4
- not compatible with latest android gradle plugin (>= 8.x.x) HOT 1
- Is their any method of this package which is through can i direct connect to the Twilio? HOT 1
- Direct Connect Flutter To Twilio HOT 1
- [IOS] Not receiving calls if App is not opened for few days HOT 2
- unregister a user and register again - calls will not comes (Failed to report incoming call successfully: The operation couldn’t be completed.)(com.apple.CallKit.error.incomingcall error 3.)
- Invalid argument(s): DEVICETOKEN is not a valid CallState.
- Android app crashes when an Incoming Call is answered with java.lang.SecurityException: Requires the RECORD_AUDIO permission HOT 4
- Answer and HangUp do not work for ringing Incoming Call on iOS.
- _prettyPrintNumber is US-only?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twilio_voice.