简体   繁体   English

带有Azure Notification Hub的Android推送通知

[英]Android Push Notification with Azure Notification Hub

I'm trying to implement Push notifications into my Android app using the Azure Notifications Hub. 我正在尝试使用Azure Notifications Hub将推送通知实施到我的Android应用中。 I have followed the instructions here but when I get to the step for Adding Azure Notification Hubs libraries I am getting stuck. 我已经按照此处的说明进行操作但是当我进入Adding Azure Notification Hubs libraries的步骤时,我陷入了困境。 First off, there is no file at the Files tab on the link they provide that is named notification-hubs-0.4.jar so I assume the one I want is notification-hubs-android-sdk-0.4.jar . 首先,在它们提供的链接的“文件”选项卡上没有文件,名为notification-hubs-0.4.jar因此我假设我要的文件是notification-hubs-android-sdk-0.4.jar So I downloaded it and included it in my assets\\libs folder. 因此,我下载了它并将其包含在我的asset \\ libs文件夹中。 I then followed the instructions and added the required lines to my build.gradle file but I keep getting an error stating 然后,我按照说明进行操作,并将必需的行添加到我的build.gradle文件中,但我不断收到错误提示

Execution failed for task ':app:processDebugResources' Process 'command 'C:\\pathtothefile...\\aapt.exe'' finished with a non-zero exit value 1. 任务':app:processDebugResources'的执行失败,过程'命令'C:\\ pathtothefile ... \\ aapt.exe'完成,退出值非零。

My build.gradle file looks like this... 我的build.gradle文件看起来像这样...

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.2'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.myapplicationid.android"
        minSdkVersion 10
        targetSdkVersion 23
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt'
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@aar'
    compile files('src/main/assets/libs/android-maps-extensions.jar')
    compile files('src/main/assets/libs/android-viewbadger.jar')
}

repositories {
    maven {
        url "http://dl.bintray.com/microsoftazuremobile/SDK"
    }
}

Am I doing something completely wrong here? 我在这里做错什么吗? Could someone please point out my error? 有人可以指出我的错误吗?

我们也将适当地更新文档,但在这样做时,将编译'com.microsoft.azure:notification-hubs-android-sdk:0.4@aar'添加到依赖项中,看看是否可行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM