문제

Weemo SDK와 지금까지 일하고 있습니다. 지금까지는 매우 유망하고 있습니다.그러나 i 앱을 기반으로 작성하는 동안 한 가지 문제가 발생했습니다.eventBus에 CallStatusChanged Listener를 등록했으며 발신자가 호출 할 때 수신자에게 이벤트를 수신하는 데 문제가 없습니다.그러나 Weemocall 객체는 잘 구성되지 않았으며 getCallId () 메서드는 0을 반환합니다 (다음 코드 참조).내 이해 이벤트에 이르기까지. getCaller는 호출자의 ID를 반환하여 전화를 확립하는 데 사용될 수 있습니다.아무도 이것을 해결할 수 있도록 도와 줄 수 있습니까?디버깅 중에 찍은 통화 개체의 스크린 샷을 첨부했습니다.

@WeemoEventListener
public void onCallStatusChanged(final CallStatusChangedEvent event){
    String msg = "";
    Log.i(TAG,"onCallStatusChanged" + event.toString());
    switch (event.getCallStatus()){
        case CREATED:
            msg = "call created";
            break;
    ...
        case RINGING:
            msg = "call is ringing";
            Intent i = new Intent(this, VideoCallingActivity.class);
            i.putExtra(INCOMING_CALL_ID_EXTRA, event.getCall().getCallId()); //getCallId returns 0 ?!
            startActivity(i);
            break;
    ...
    }
    Log.i(TAG,msg);
}
.

여기에 이미지 설명

도움이 되었습니까?

해결책

WeemoCall.getCallId() 메소드는 내부적으로 인덱스로 사용되는 int를 리턴합니다.
이렇게하면 첫 번째 호출은 getCallId()0와 같을 것이고, 두 번째는 1 등과 등등을 가질 것입니다.

이므로 두 번째 활동에 해당 Weemocall 객체를 가져 오려면 다음을 수행 할 수 있습니다.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    int callId = savedInstanceState.getInt(INCOMING_CALL_ID_EXTRA);
    WeemoCall call = Weemo.instance().getCall(callId);
}
.

현재 Weemocall을 반환 할이 메소드를 사용할 수도 있습니다.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    WeemoCall call = Weemo.instance().getCurrentCall();
}
.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top