Unity Windows Phone Push Notification error (need help)

0 votes

Hi,
While i was trying to send push notification Windows Phone by using unity code project, i followed your tutorial which is given in that link " http://api.shephertz.com/tutorial/Push-Notification-Unity-WindowsPhone/  "
I followed all steps but still there is something wrong.

After doing these step i get error.

- Set API key and SECRET key on "Constants.cs"
- Build project for windows phone.
- Adding suitable capabilities

- Running on device.
- Pressing "App42 Login" button
- Pressing "Register" button.  and that point i get error message. İ copied/pasted the error message and sen screenshot.


---
"InvalidOperationException was unhandled by user code
An exception of type 'System.InvalidOperationException' occurred in Microsoft.Phone.ni.dll but was not handled in user code

Additional information: Open failed because the channel was already open.  You can find an open channel by calling the Find method."
---

I also sending screenshot of error message.

http://postimg.org/image/8gyn82abj/

Thanks helping. Have a nice day.

asked Jul 8, 2014 in App42 Cloud API-BaaS by onurdilek (10 points)

1 Answer

0 votes
Hi,

Thanks for wiriting to us.

As per the screenshot attached it seems you are trying to use same userid to register a channel with MPNS for Tile and Toast type of Notification.

As described in the sample it will accept the notification request of users only for one type either that will be of Toast or it will be Tile. If you can change the user id for notification request type, it will work.

Let me know if it answers your question.

Thanks.
answered Jul 8, 2014 by hs00105 (517 points)
Thank you for answering but it doesnt work.

It is not releated with notification type, i tried for single type but result is same.

Moreover, i try to find open channel with same channel name by using these code:
"HttpNotificationChannel.Find(Constants.UserId);"
it returns null.  (Constants.UserId  is used for a channel name when i try to create new channel.).
After building unity project, i add that code in "MainPage.xaml.cs".
Is there any code that returns open channels or something like that in unity for app42  platform.

Thanks.
Can you please, uninstall the application from your device first and reboot your device and install the application again ?
I did what you say and now i can register my device on app42 server.
But now , i have another problem , my device cannot take push notification. There is no error message.
I did not change the sample code but still it doesnt work.

By the way thanks for your interest and helpful advice
Can you please check your push logs in AppHQ under push notification section when you send the message to your device and share with us ?
Push log is that:
Module:
App42_PushNotification

Type:
INFO

Message:
WP PushNotification : http://db3.notify.live.net/throttledthirdparty/01.00/AQGHwplMvtbyQKfeXOva0uDOAgAAAAADtAAAAAQUZm52OjYzQTE2NDVEQzYxMkNGMTkFBkVVV0UwMQ : Suppressed : Active : Connected
The Suppressed status can occur if the notification type was not enabled by calling Tile in the client application, if the notification was sent when the Tile application is not on pinned to start.

As described in the sample your device is registered for Tile push notification. Kindly find the link below for sending a tile notification to your windows phone device.
http://api.shephertz.com/tutorial/Push-Notification-WindowsPhone/?index=pn-wp

Let me know if it helps.
Thanks.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...