小编Jea*_*len的帖子

Sinch 无法在后台运行(Android)

美好的一天。我正在使用 sinch 进行音频通话。我不知道该怎么做,并且没有明确的 sinch 文档(这非常令人沮丧),这让我知道如何让 sinch 客户端在后台运行以进行监听应用程序被杀时后台来电。同时我认为我强迫sinch客户端不会被终止,但每次应用程序打开时,客户端无论如何都会启动。所以如果有人遇到这样的事情,你能帮我吗并告诉我如何使用 Sinch 在后台监听来电?发布我已经启动并运行的代码。

由我的所有活动继承的基础活动。

import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import ink.service.SinchService;

/**
 * Created by USER on 2016-07-24.
 */
public abstract class BaseActivity extends AppCompatActivity implements ServiceConnection {
    private SinchService.SinchServiceInterface mSinchServiceInterface;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getApplicationContext().bindService(new Intent(this, SinchService.class), this,
                BIND_AUTO_CREATE);
    }

    @Override
    public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
        if (SinchService.class.getName().equals(componentName.getClassName())) {
            mSinchServiceInterface = (SinchService.SinchServiceInterface) iBinder;
            onServiceConnected();
        }
    }

    @Override
    public void …
Run Code Online (Sandbox Code Playgroud)

audio android call sinch android-sinch-api

0
推荐指数
1
解决办法
2298
查看次数

标签 统计

android ×1

android-sinch-api ×1

audio ×1

call ×1

sinch ×1