NotificationsRegistrationHandler is not being called on iOS - android

I have an app working and published in the Apple's app store. We are developing an update with new features and I noticed that the NotificationsRegistrationHandler is not being called anymore on iOS when the user accepts to receive notification (in Android is working fine). Which means the application is not getting the "DeviceToken", so we are unable to send notification. The proc. is very simple, and doesn't look like the issue because it's working for Android devices:
for each
where DeviceType = &DeviceType // enum domain SmartDeviceType
where DeviceId = &DeviceId // Character(128)
DeviceToken = &DeviceToken // Character(255)
DeviceName = &DeviceName // Character(128)
when none
new
DeviceType = &DeviceType
DeviceId = &DeviceId
DeviceToken = &DeviceToken
DeviceName = &DeviceName
endnew
endfor
What I have tried so far:
Generate and install new distribuition certificates and provision profiles.
Rebuild All, Build With This Only, etc.
Tested in "TestFlight" also.
Tested in different devices.
The published app right now is working, however I fear to publish this upgrade and screw up the notification.
I'm using GeneXus Evo 3 U2, .NET generator and Oracle.
Any suggestion how to fix this?
EDIT: Tested with distribuition certificate and sandbox=false, builded for distribuition and sended to testflight, same problem. =/

Have you checked that in the Provisioning Profile (developer.apple.com) the Push Notification service is active:
Enabled Services:
Game Center, In-App Purchase, Push Notifications

I fixed, here is what I did:
Updated from "U2" to "U8". Since "U8" have some OSX and XCode version requirements I updated both to the lastest versions.
Now "NotificationRegistrationHadler" is being called as normal.

Related

why do I receive multiple FCM notifications on android 7

I am trying to integrate FCM notification in my project. I have Cloud Function backend, and app runs on android.
Below is cloud code to send notification:
exports.notificationTest = functions.database.ref(`/test/childA/childB/status`).onUpdate(event => {
const status = event.data.val();
console.info("Processing notificationTest cloud function")
console.info(`status : ${status}`)
const token = "EnterYourNotificationTokenHere"
const randomNum = Math.floor(Math.random() * 100)
var message = {
notification: { title : "My App", body : `Notification Test ${randomNum}`}
}
console.info(`Sending message on notification token`)
return admin.messaging().sendToDevice(token, message)
.then((response) => {
console.info("Successfully sent notification")
}).catch(function(error) {
console.warn("Error sending notification " , error)
})
})
On native Android app, I receive notification multiple times with interval of few mins.
Here, I have seen notification like this:
Notification Test 30
then after 2,4,8,16,32 mins of previous notification time I again get below message
Notification Test 30
I don't think I need to paste log here, because code is definitely executed just once (as the random number in notification stays the same).
So, why is this happening and how to fix it?
Below is my environment:
Native Android App
Using Android 7
Latest Android Studio Stable
Android Gradle Plugin - 3.1.1
Gradle - 4.1
Firebase-Ui - 3.1.0
Play Services - 11.4.2
Please try to reproduce in environment mentioned above.
I have resolved the issue by renaming my application package name
eg old name: com.xyz to com.xyz2
Using the new name i added this (new) android app to firebase project (it generated new app id). And the notifications started worked as expected (no retry).
But its a shame that I have to rename app package to resolve it. If this app was released in google play then I could not have renamed the app, else no one can get further updates on this app, and it becomes a new app!
It would still be great if some firebase developers could shed light on what is happening.
Recreating firebase project and recreating android project did not help when app name / top level package name were the same. Changing app name and relevant namespaces in existing android project fixed it for now.
Ideally I would like to know the proper fix for this and use the existing name rather than suffixing 2 at the end of app name.
I just had this same issue occur with my Ionic Android app. The same notification repeated after 2, 4, and 8 minutes. This seems to be an issue on the client side because it even happens when sending a message directly from the Firebase console.
I tried several things to fix it and it seems like the only way I could get it to work as intended was to make a new Android project and new Firebase app.

Firebase Invite does not send invites after update

I am working on the debug version of an android app. I was able to send both SMS and email invites until I recently installed a different OS on my machine (both Linux). As a result, I also updated Android Studio to the latest version, and imported my old project settings. The rest of the application works fine, I can also start the activity for selecting invites, it displays the message that Invitation was sent, but AppInviteInvitation.getInvitationIds returns 0 length array in onActivityResult.
I tried to add Sha1 and Sha256 to the app in the Firebase console, removed Firebase completely and then added it back to the android project in Android Studio (also removed and added again application and project in the firebase console). So checked and tried most of the solutions on SO, but none seems to work. I am probably omitting something. I am using two google accounts, one for firebase, one for email sending from device.
What else could I verify? Is there any way to dig deeper in Firebase invites in order to find the issue?
The intent:
private void onInviteClicked() {
Intent intent = new AppInviteInvitation.IntentBuilder("MyApp")
.setMessage("Some message of 90 nospecial chars")
// .setDeepLink(createDynamicLink(2))
.setCustomImage(Uri.parse("http://correct url"))
.setCallToActionText("Call to action")
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
Short: keep message short (tested with < 40 chars)
Long: My intent actually contained a 90 character message (no special chars), which was sent just fine before the update. After the update, I need to reduce the length of the message (tested with ~40 characters, none is special), in order for it to be sent.
I wonder what determined this behavior. Things that were changed: java (previously was oracle jdk, now it is the java that comes by default with Android Studio); Maybe also java version. Build tools version 25.0.2 -> 26.0.0.

Azure notification hub cross platform push

I need to send a push notification to mobile devices that have registered on my notification hub.
The hub is set up to allow windows phone, apple and android devices to register, and I have the appropriate keys and certificates in place. (According to the documentation!)
I am using the latest release of the Microsoft.Azure.NotificationHubs namespace, version 2.16, as advised by the NuGet package manager.
I want to send one message, to all registrations as well as sending a message to a specific device. I can see the devices have all registered correctly with the hub, and have tags that allow me to send notifications to them.
I am trying to use the SendDirectNotificationAsync() method
that takes a Dictionary and a string tag as parameters.
I have also tried the SendNotificationAsync() method that takes a Notification object as a parameter.
Neither method causes a notification to appear on my windows phone with the parameters I have provided, so without an example or more information from the help files, I am stuck.
I cannot find any current examples using these methods and classes.
The examples I have found pre-date the release, and do not show what to send to the notification hub for a cross platform notification to work.
I know these have only just been released, but any help / guidance would be appreciated, as I have reached a complete dead-end with this.
Just a quick update...
Although I never got this to work as I wanted to (as described above), what I ended up doing was to use each platforms native notification as below;
var result1 = await hub.SendMpnsNativeNotificationAsync(windowstoast, mobileDeviceId);
var result2 = await hub.SendGcmNativeNotificationAsync(androidToast, mobileDeviceId);
var result3 = await hub.SendAppleNativeNotificationAsync(iOStoast, mobileDeviceId);
The 'toast' was formatted as per the individual platforms requirements in the documentation.
The 'mobileDeviceId' was the tag that each device registered with the notification hub.
So, clumsy, but it works reliably to achieve the same end.
I still would like to get the cross platform way to work though. Will look into it a bit more when I have time.

Custom Receiver Not Loading in Chrome Cast Device

I have a chromecast app with a custom receiver served through Google App Engine. My friend added my device and his to the Google Cast SDK Developer console.
As done in CastHelloText example app (https://github.com/googlecast/CastHelloText-android), I use the following snippet in my android app:
// configure cast device discovery
mMediaRouter = MediaRouter.getInstance(getApplicationContext());
mMediaRouteSelector = new MediaRouteSelector.Builder()
.addControlCategory(
CastMediaControlIntent.categoryForCast(getResources()
.getString(R.string.app_id))).build();
mMediaRouterCallback = new MyMediaRouterCallback();
Note:
I used my app_id that I got from developer console.
For some reasons, my friend is able to load the custom receiver using the Android app. But I am not able to do so. I have done the following with no help:
1) Restart the chrome cast device several times.
2) Factory reset the device.
My current firmware version: 27946
If I use the app_id from CastHelloText app, the same snippet works fine.
How do I confirm that my chrome cast device has loaded/aware of my custom receiver?
Make sure you have entered the correct serial number (from your device); it is often tricky to read that; take a photo and enlarge that. If problem persists, please contact our support.

What would cause an app to work when installed via USB, but not when installed from the Play store

I have a Titanium Android app that I'm developing and recently deployed to the Google Play store. The app works just fine when I install it directly on the device from the Titanium Studio workspace; however, when I try to install it from the Google Play store it does not work. The "does not work" feature in question here is a call to an https web service to authenticate a user. Also, I've noticed that ICS users are able to get the app to work from the Play store, whereas Gingerbread users are not if that's helpful.
This is the code that causes a problem:
var actInd=Titanium.UI.createActivityIndicator({height:80, width:200, message:'Logging In...', font:{fontFamily:'Helvetica Neue', fontSize:18,fontWeight:'bold'}, color:'white', style: Titanium.UI.iPhone.ActivityIndicatorStyle.BIG});
actInd.show();
//Validating Data
var xhr2 = Titanium.Network.createHTTPClient();
xhr2.onload = function(){
var response=JSON.parse(this.responseText);
if(response.resultinfo.result){
ticket = response.resultinfo.ticket;
Titanium.App.Properties.setString("uname",username.value);
actInd.message='Successful...';
actInd.show();
}
};
xhr2.onerror = function(){
Ti.API.info('in utf-8 error for GET');
};
xhr2.open("GET","https://example.com/login.cfm");
xhr2.send({"userid":username.value,"password":password.value});
In the problem case the app just hangs on showing the "Logging In..." message.
Thanks to #Hydrangea I was able to isolate the problem as a certificate validation error. Apparently there is an issue with some versions of Android prior to ICS not correctly validating valid SSL certificates even though they are setup properly. There is a setting in the Titanium.Network.HTTPClient called "validatesSecureCertificate" that defaults to false for testing, but to true when an app is released for distribution. This is why the problem was occurring only on the Play store version. Setting this to false seems to solve the problem and I believe it is safe to do so at a per-call level.

Categories

Resources