mon*_*uiz 5 apple-push-notifications ios moonapns
我正在使用此代码将Apple推送通知发送到iPhone:
Public Function SendPush() As String
Dim rt As String = "Sended!"
Dim deviceToken As String = "my token"
Dim message As String = "Parabéns é Campeão!"
Try
Dim payLoad As New NotificationPayload(deviceToken, message, 1, "default")
payLoad.AddCustom("RegionID", "IDQ10150")
' 51 is the badge no
Dim notificationList = New List(Of NotificationPayload)() From { _
payload _
}
Dim push = New PushNotification(True, "apn_developer_identity.p12", "password")
Dim result = push.SendToApple(notificationList)
Catch ex As Exception
rt = "Error!"
End Try
Return rt
End Function
Run Code Online (Sandbox Code Playgroud)
但在我的iPhone中没有收到口音.我收到了这个:Parab?ns?Campe?哦!
关于会发生什么的想法?
问候
解决了!
我在PushNotification.cs类中更改了库Moon-APNS:
// String length
byte[] apnMessageLength = BitConverter.GetBytes((Int16)Encoding.UTF8.GetBytes(apnMessage).Length);
// Write the message
memoryStream.Write(Encoding.UTF8.GetBytes(apnMessage), 0, Encoding.UTF8.GetBytes(apnMessage).Length);
Run Code Online (Sandbox Code Playgroud)
重新编译并使用到您的项目中.现在接受拉丁字符.
| 归档时间: |
|
| 查看次数: |
1348 次 |
| 最近记录: |