Push Notification RegistrationID

I’m experimenting with Push notifications for ios and the example was able to log the registrationID the first time, but has not logged it again since.

Is there a method to access the registrationId other than through push.onRegistrationSucceeded The registrationID is needed in order to do testing with NWpusher.

Example:

MainView.ux

<App Theme="Basic">
    <FuseJS.Push ux:Global="Push" />
    <JavaScript>
        var push = require("Push");

        push.onRegistrationSucceeded = function(regID) {
            console.log("Reg Succeeded: " + regID);
        };

        push.onRegistrationFailed = function(reason) {
            console.log("Reg Failed: " + reason);
        };

        push.onReceivedMessage = function(payload) {
            console.log("Recieved Push Notification: " + payload);
        };
    </JavaScript>
</App>

project.unoproj

{
  "RootNamespace":"",
  "Packages": [
        "Fuse.PushNotifications",
        "Fuse.Animations",
        "Fuse.BasicTheme",
        "Fuse.Themes",
        "Fuse.Controls",
        "Fuse.Designer",
        "Fuse.Drawing",
        "Fuse.Drawing.Primitives",
        "Fuse.Effects",
        "Fuse.Elements",
        "Fuse.Entities",
        "Fuse.Gestures",
        "Fuse.Navigation",
        "Fuse.Shapes",
        "Fuse.Triggers",
        "Fuse.Reactive",
        "Fuse.Android",
        "Fuse.Desktop",
        "Fuse.Maps",
        "Fuse.iOS",
        "FuseCore",
        "Uno.Collections",
        "Uno.Geometry"
  ],
  "Includes": [
    "*"
  ],
}

Hi Patrick,

Sorry to hear about the issue. I have raised a ticket to have a look at this and will get back to you as soon as we have some news.

Regards Chris

I have poking this code again but have been unable to reproduce the issue. I’m seeing the Reg Succeeded log on each startup. In XCode do you see any other messages in the log?

Sorry for the lack of good leads on this. Regards

[EDIT] Just to clarify this is working for me with your exact UX/JS code. Are you sure your certificates have not expired?

Tentatively closing this issue as unable to reproduce and no extra data available. Feel free to bump if you find out something new

A lot of months ago, I have the same “issue”, this week I need it for an app and finally found “the problem”.

The api doesn’t work in the normal Fuse Dashboard > App Preview > iOS > XCode, that means, doesn’t work with the proxy, we need to build it with the command:

fuse build --target=iOS -adebug

this command will open the XCode and then we can configure the capabilities (Push Notifications) and the certificate to receive notifications, only then then it will work. In fact in the proxy doesnt even fire the error callback (onRegistrationFailed).

Its clear to me that, this is not a bug or a software problem, maybe for many programmers it was pretty obvious, but not for me, maybe this missing step (the fuse build step) should be in a special remark in this page:

https://www.fusetools.com/docs/fuse/pushnotifications/push