Giter VIP home page Giter VIP logo

Comments (16)

cybex-dev avatar cybex-dev commented on July 29, 2024 2

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.

cybex-dev avatar cybex-dev commented on July 29, 2024 1

@diegogarciar what do you have in mind to address this - do you want to stick with the registerClient() function or add an addition for callerNames implemented natively with optional clientImageUrls 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.

diegogarciar avatar diegogarciar commented on July 29, 2024 1

@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.

victor-padovam avatar victor-padovam commented on July 29, 2024 1

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();
                }
            });
        }
    }

stack Overflow

Result:

stack Overflow

from twilio_voice.

victor-padovam avatar victor-padovam commented on July 29, 2024

@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 avatar cybex-dev commented on July 29, 2024

@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.

  1. 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.

  1. 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.

victor-padovam avatar victor-padovam commented on July 29, 2024

@cybex-dev Thank you for your help.
I made the first step

  1. 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:

stack Overflow

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.

stack Overflow

since everything is arriving correctly, as I specify to throw this information to the background screen when it's ringing
.

from twilio_voice.

victor-padovam avatar victor-padovam commented on July 29, 2024

amazing, we are waiting for the return of the @diegogarciar

from twilio_voice.

victor-padovam avatar victor-padovam commented on July 29, 2024

@cybex-dev As soon as you go up, let me know.
thnks.

from twilio_voice.

victor-padovam avatar victor-padovam commented on July 29, 2024

@ cybex-dev você adicionou o PR?

from twilio_voice.

victor-padovam avatar victor-padovam commented on July 29, 2024

Any solution ?
keeps appearing to me unknown.

from twilio_voice.

cybex-dev avatar cybex-dev commented on July 29, 2024

It's been far too long - will be adding in upcoming update.

iOS, Android & Web.

from twilio_voice.

cybex-dev avatar cybex-dev commented on July 29, 2024

@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.

cybex-dev avatar cybex-dev commented on July 29, 2024

Check out #151 merged

from twilio_voice.

cybex-dev avatar cybex-dev commented on July 29, 2024

See release 0.1.0

from twilio_voice.

victor-padovam avatar victor-padovam commented on July 29, 2024

A few years ago, today doesn't help in nothing 👎🏻

from twilio_voice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.