하늘색 알림 허브를 조사 중이며 메시지를 보내고받는 데 성공했지만 프로그램 방식으로 허브를 구성해야합니다.프로그래밍 방식으로 또는 CLI를 통해 하늘색 알림 허브에 APNS 인증서를 업로드 할 수 있습니까?
알림 허브를 만들 수있는 유일한 방법은 this one과 같은 azuredeploy.json ARM 템플릿이있는 azure cli를 사용하는 것입니다. 그러나 APNS 인증서를 추가하는 방법에 대한 정보를 찾을 수 없습니다.
Google 허브에서 생성 된 자동화 스크립트를 보면 google firebase API 키 또는 APNS 인증서가 없음을 알 수 있습니다. 이것이 가능합니까? 아니면 언제나 하늘빛 문을 통해 이루어져야합니다.
UPDATED : 약간의 문제가있는 arm 템플릿을 사용하여 알림 허브 네임 스페이스를 만들었지 만 만들려고 할 때 "잘못된 요청"(상관 ID - 3faee649-7084-436d-8d7e-4a9c6f79cc4e)이 나타납니다. apns 인증서가있는 알림 허브 자체
this post은 비슷한 문제가있는 사람이지만 apns의 키는 내 것보다 훨씬 짧습니다. 나는 문자 그대로 5000+ 문자가 틀린 인증서 파일에서 base64 문자열을 만들었지 만 그 값이 틀리다고 가정합니다.하지만 사과에서 어떤 값을 가져올 지 알 수 없습니다.
내 템플릿은 다음과 같습니다
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": {
}
}
내가 속성 및 자격 증명을 제거하면 I 성공적으로 네임 스페이스와 허브를 만들 수 있습니다. 그러나 나는 어떻게 든 programatically 그들을 추가해야합니다. 사실 이후 또는이 템플릿의 일부로. –