简体   繁体   中英

WP7 Push notifications not working after app has been published

I'm using toast notifications for my phone app. When the app is first started on someones phone it will get the push notification URL and then store it in our database so we can send notifications down to the user.

In testing, using both the emulator and testing on my HTC WP7 the notification was found and uploaded.

Now the application is in the store, notification URL's are coming to the server as NULL. In the app dashboard I'm getting the following:

Missing certificate for authenticated push notifications: Certificate for authenticated push notifications

Would this be causing the issue? If so, how do I go about getting this certificate? I can't find anything relating to this anywhere.

Below is a code snippet, which worked in testing but since publishing to the store is always returning NULL:

private void BindChannel()
    {
        channel = HttpNotificationChannel.Find(channelName);

        if (channel == null || channel.ChannelUri == null)
        {
            if (channel != null) DisposeChannel();

            channel = new HttpNotificationChannel(channelName);
            channel.ChannelUriUpdated += channel_ChannelUriUpdated;
            channel.Open();
        }
        else
        {
            StorageSettings.StoreSetting("NotifyURL", channel.ChannelUri.AbsoluteUri); 
        }

        SubscribeToChannelEvents();

        if (!channel.IsShellTileBound) channel.BindToShellTile();
        if (!channel.IsShellToastBound) channel.BindToShellToast();

        string notificationUri = string.Empty;

        if (StorageSettings.TryGetSetting<string>("NotifyURL", out notificationUri))
        {
            if (notificationUri != channel.ChannelUri.AbsoluteUri)
            {
                StorageSettings.StoreSetting("NotifyURL", channel.ChannelUri.AbsoluteUri);
            }
        }
        else
        {
            if (channel.ChannelUri != null)
            {
                StorageSettings.StoreSetting("NotifyURL", channel.ChannelUri.AbsoluteUri);
            }
        }

    }

Actully i am getting also null url but in my side its WNS not responding after some time it will working fine.

And I think bellow link may be help you

Overview of pushnotification

How to authenticate with the Windows Push Notification Service (WNS) (Windows)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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