4 Star 4 Fork 2

华为移动服务 / hms-nearby-contactshield-internals

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ContacShieldWrapperREADME.md 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
chenzelin 提交于 2020-11-25 15:59 . Initial commit

ContactShieldWrapper Guidance:

  • Integration of HMS ContactShield

    Modify the gradle file:

    // Project gradle
    buildscript {
        repositories {
            maven { url 'http://developer.huawei.com/repo/' }
        }
    }
    
    allprojects {
        repositories {
            maven {url 'http://developer.huawei.com/repo/'}
        }
    }
    
    // app gradle
    implementation 'com.huawei.hms:contactshield:5.0.3.300'
  • Apply ContactShieldWrapper

    // Get ContactShieldWrapper instance
    ContactShieldWrapper contactShieldWrapper = ContactShieldWrapper.getInstance(context);
    
    // Call HMS ContactShield API with ContactShieldWrapper instance
    contactShieldWrapper.start();
    contactShieldWrapper.stop();
    contactShieldWrapper.isEnable();
    contactShieldWrapper.getTemporaryExposureKeyHistory();
    contactShieldWrapper.provideDiagnosisKeys(files, exposureConfiguration, token);
    contactShieldWrapper.getExposureSummary(token);
    contactShieldWrapper.getExposureInformation(token);
    
    // Convert data types with static methods of ContactShieldWrapper
    ContactShieldWrapper.getExposureSummary(contactSketch);
    ContactShieldWrapper.getExposureInformationList(contactDetailList);
    ContactShieldWrapper.getTemporaryExposureKeyList(periodicKeyList);
    
    // Add BackgroundContactShieldIntentService in AndroidManifest.xml
    <service android:name=".nearby.BackgroundContactShieldIntentService"
              android:enabled="true"
              android:exported="true"/>
Java
1
https://gitee.com/hms-core/hms-nearby-contactshield-internals.git
git@gitee.com:hms-core/hms-nearby-contactshield-internals.git
hms-core
hms-nearby-contactshield-internals
hms-nearby-contactshield-internals
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891