紺碧の通知ハブを調査しており、メッセージの送受信に成功している間にハブを計画的に設定する必要もあります。APNS証明書を計画的にまたはCLIを介して紺碧の通知ハブにアップロードすることは可能ですか
通知ハブを作成できる唯一の方法は、this oneのようなazuredeploy.json ARMテンプレートを使用したazure cliを使用することです。しかし、私はそれにAPNS証明書を追加するための情報を見つけることができません。
私たちのハブから生成されたオートメーションスクリプトを見ると、google firebase APIキーまたはAPNS証明書の証拠はありません。これは可能なのですか、またはこれらはazure portalを通していつでも実行する必要がありますか?
UPDATED:アームテンプレートを少し問題なく使用して通知ハブ空間を作成することができましたが、作成しようとすると「悪い要求」(相関ID - 3faee649-7084-436d-8d7e-4a9c6f79cc4e)通知ハブ自身がapns証明書を持っています。
this postは同様の問題を抱えていますが、apnsのキーは私のものよりもはるかに短いです。私は文字通り、5000文字以上の間違った証明書ファイルからbase64文字列を作成しましたが、それは間違っていると思いますが、Appleの値がここに入ることを意味するものではありません。マイテンプレートはこのようになります
:apnsCredentialsプロパティで
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"Gcm.GoogleApiKey": {
"type": "string",
"metadata": {
"description": "Google Cloud Messaging API Key"
},
"defaultValue": ""
},
"Apns.apnsCertificate": {
"type": "string",
"metadata": {
"description": "A certificate (in base 64 format) provided by Apple on the iOS Provisioning Portal"
}
},
"Apns.certificateKey": {
"type": "string",
"metadata": {
"description": "The Certificate Key provided by the iOS Provisioning Portal when registering the application"
},
"defaultValue": ""
},
"Apns.endpoint": {
"type": "string",
"metadata": {
"description": "The APNS endpoint to which our service connects. This is one of two values: gateway.sandbox.push.apple.com for the sandbox endpoint or gateway.push.apple.com, for the production endpoint. Any other value is invalid"
},
"defaultValue": "gateway.sandbox.push.apple.com"
}
},
"variables": {
"hubVersion": "[providers('Microsoft.NotificationHubs', 'namespaces').apiVersions[0]]",
"notificationHubNamespace": "[concat('hubv2', uniqueString(resourceGroup().id))]",
"notificationHubName": "notificationhub"
},
"resources": [
{
"name": "[variables('NotificationHubNamespace')]",
"location": "[resourceGroup().location]",
"type": "Microsoft.NotificationHubs/namespaces",
"apiVersion": "2017-04-01",
"comments": "Notification hub namespace",
"properties": {
"namespaceType": "NotificationHub"
},
"resources": [
{
"name": "[concat(variables('NotificationHubNamespace'),'/',variables('NotificationHubName'))]",
"location": "[resourceGroup().location]",
"type": "Microsoft.NotificationHubs/namespaces/notificationHubs",
"apiVersion": "2017-04-01",
"properties": {
"GcmCredential": {
"properties": {
"googleApiKey": "[parameters('Gcm.GoogleApiKey')]",
"gcmEndpoint": "https://android.googleapis.com/gcm/send"
}
},
"apnsCredential": {
"properties": {
"apnsCertificate" : "[parameters('Apns.apnsCertificate')]",
"certificateKey" : "[parameters('Apns.certificateKey')]",
"endpoint" : "[parameters('Apns.endpoint')]"
}
}
},
"dependsOn": [
"[concat('Microsoft.NotificationHubs/namespaces/', variables('NotificationHubNamespace'))]"
]
}
]
}
],
"outputs": {
}
}
私はプロパティと資格情報を削除した場合、私は成功した名前空間とハブを作成することができます。しかし、私はそれらをプログラム的に何とか追加する必要があります。実際の後、またはこのテンプレートの一部として。 –