PushNotification crucial problem

Dear Sirs,

We have a crucial problem with PushNotification module on Both Android and iOS and the problem is :
When the registration got succeeded the Event Emitter is not fired neither on Success nor on Failure ! and i have investigated the problem and modified some lines to find out the problem and it was as the following:

new AsyncTask<Void, Void, String>() {
	@Override protected String doInBackground(Void... params) {
		debug_log("START Requesting the RegID");
		String msg = "";
		try {
			String _regID = gcm.register(senderID);
			debug_log("RegID is success");
			@{getRegistrationIdSuccess(string):Call(_regID)};
			return "Device registered, registration ID=" + _regID;
		} catch (java.io.IOException ex) {
			debug_log("RegID is failed");
			debug_log(ex.getMessage());
			msg = "Error :" + ex.getMessage();
			@{getRegistrationIdError(string):Call(msg)};
			return msg;
		}
	}
	@Override protected void onPostExecute(String msg) {}
}.execute();

This problem was visible at many apps i have developed, in some apps only in the MainView.ux give me a callback and the rest sometime yes and the most is not !

So, please figure out the problem and have a hotfix soon.

PS: i’m using Cloned version of Fuselibs from the master branch.

Best,
Ahmad

And here is the screenshot from my device log, you will see the

REG ID PROVE --> this line is printed out from the Impl.uno file inside the following method :

		static void getRegistrationIdSuccess(string regid)
		{
			debug_log("REG ID Prove : "+regid);
			var x = RegistrationSucceeded;
			if (x!=null)
				x(null, regid);
		}

Sorry, but it is not clear what the issue is.

The log statement you have added is being executed. So the callback to getRegistrationIdSuccess was raised, but you’re saying it was not.

There is nothing we can do until you provide a complete reproduction and a clear description of the problem.

This Event is not fired all the time; When it listed at MainView.ux -> it always fires

push.on("registrationSucceeded", function(regID) {
});

No, it should not always fire. This assumption is wrong. It only fires when the particular device gets a new token from GCM/FCM/APNS.

It is the Apple/Google backend that decides when a new token needs to be issued, and we have no control over that.

Hey Uldis, you didn’t get the error. the error is on the Callback only !
I have added some lines to detect the problem source and it was from your side because:

1- I have initiate the Push.
2- The Push notification generates the RegID.
3- I have print out the RegID.
4- The library then fires emit the event registrationSucceeded.
5- The UX event never fired --> this is the problem that not all the time i’m getting notified .

You say: Push notification generates the RegID. No, it does not. I explained that in my post above.

Until you provide a perfectly clear description of the problem (no, you haven’t), there is nothing else we can do. I’m doing my best to try and understand what you’re reporting, but currently all I see is false expectations.

Bad news :wink: you have to understand me

My interpretation of the problem is (after discussing a little with Ahmed on slack):

He is trying to say that when he attaches the registrationSucceded handler in the root of MainView.ux, then he gets the callback all the time, while if he does so in a different view, it starts to be faulty. This sounds to me like a race condition with the event.

push.on("registrationSucceeded", function() {... - if the callback here is registered “too late” then it never gets the memo. The event emitter probably needs to fire on subscription if the registration has already succeded.

But this is not my domain, I’m poking some guys internally to have a closer look.

Thanks for your assist