"Registration" for an ionic3 app using phonegap-push-plugin - push-notification

I developed an ionic3 app that uses phonegap-push-plugin in order to recive push-notifications.
Does anyone knows how many time do I have to call "registration" like this
pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration));
a) Do I have to make a "registration" every time I open my app?
b) Or is enought only once after first installing the app?
... and why ?
Thanks.

According to this Register a device on GCM every time the app start is the right approach?
the answer is:
1. Every time the app is updated
2. When the phone restarts
Is it possible, beside these 2 cases, to have a third namely "when OS is updated"?

Related

Missing videoTrack in a multitrack stream in Ant media server 2.4.1

We have a Multitrack web conference implementation using AMS 2.4.1 version. Its working great for our use case, except in one scenario. When there are N (< 3) number of users and they on there camera simultaneously, then few remote users are not rendered as we don't receive the video tracks for those users in newStreamAvailable. We only receive the audio track for those users. We are able to reproduce this quite frequently.
As a backup, I am trying to poll AMS using getTrackList with the main track Id to get all available streams, but I am not getting any message trackList
var jsCmd =
{
command : "getTrackList",
streamId : streamId, // this is roomId or main track id
token : token
}
Any insight would be helpful.
Thanks,
We were able to resolve the issue, posting here to help anyone who might be facing a similar issue.
With push notifications from the server, we might encounter issues when for some reason push operation doesn't succeed. In that case, it's better to have a backup plan to pull from the server and sync.
The Ant Media Server suggests pulling the server periodically for the room info. The server will respond with active streams and the application should synchronize.
For reference, please refer to following link https://resources.antmedia.io/docs/webrtc-websocket-messaging-reference

How to setup web hooks to send message to Slack when Firebase functions crash?

I need to actively receive crash notifications for firebase functions.
Is there any way to set up Slack webhooks to receive a message when Firebase Functions throw an Error, functions crash, or something like that?
I would love to receive issue messages by velocity ie: Firebase Functions crash 50 times a day.
Thank you so much.
First you have to create a log based (counter) metric that will be counting specific error occurencies and second - you create alerting policy with Slack notification channel.
Let's start from finding corresponding logs that appear when the function throws an error. Since I didn't have one that would crash I used logs that indicated that it was started.
Next you have to create a log based metric. Ignore the next screen and go to Monitoring > Alerting. Click on "Create new policy", find your metric and select "Rolling Window" to whatever time period you need. For testing I used 1 minute. Then set "Rollind windows function" to "mean".
Now configure when the alert has to be triggered - I chose over 3 (within 1 minute window).
On the next screen you select notification channel. In case of Slack it has to be configured first in "Notification Channels".
You can save policy the policy now.
After a few minutes I gathered enough data to generate two incidents:
And here's some alerting related documentation that may help you understand how to use them.

Firebase auto save Timestamp -flutter

i build a chat app using flutter and i save each message with datetime of unitime and thats ok
now when i tested the app on 2 devices the have 2 min difference so this caused a problem that the messages was not displayed correctly couse there is a difference in time
Is there was to let firebase saves the current server time (of firebase itself)
thanks
fixed it by : FieldValue.serverTimestamp()

How to find the current activity of an app in ios

I am using Appium for IOS testing. (java) I want to be able to check the current activity of an app . In the sense when an App switches from clickable to another (say I close the app or switch to another app or open the notifications scroll. I want to be able to detect the page name. To get the current activity name, i use driver.currentActivity(); which is included in the AndroidDriver class.
but There is no direct call for current package in ios, but many suggested that can be found out by looking at the attributes of existing elements in the device screen by calling driver.getPageSource(); how can I achieve this using driver.getPageSource or is there any other way to do it?Any advise on this would be helpful.
You can query current app state, if you have the bundleId of the app then you can
query it's state if its running in background or foreground and it solves your problem.
Map<String, Object> params = new HashMap<>();
params.put("bundleId", "com.myapp");
final int state = (Integer)js.executeScript("mobile: queryAppState", params);
There can be 5 possible state as per the documentation.
0: The current application state cannot be determined/is unknown
1: The application is not running
2: The application is running in the background and is suspended
3: The application is running in the background and is not suspended
4: The application is running in the foreground
Refrences
To see if your app is running, assuming you know the bundleId, you can use the driver directly:
driver.queryAppState('com.apple.Preferences');
It returns the ApplicationState:
NOT_INSTALLED,
NOT_RUNNING,
RUNNING_IN_BACKGROUND_SUSPENDED,
RUNNING_IN_BACKGROUND,
RUNNING_IN_FOREGROUND

HKWorkoutSession isn't keeping app at front of Apple Watch

It has been stated that an app running a HKWorkoutSession will have special privileges over other watchOS 2 apps, so when a user looks at their Apple Watch, it will go to the view showing running a workout rather than the watch face.
Currently, on both my device and simulator, this is not the case. If I start a HKWorkoutSession and then leave for 5 minutes and then interact with either the Apple Watch, or the Watch Simulator, it presents the watch face.
If I then open my app, it appears to have been frozen, rather than terminated (which is what I imagine happens to other apps). As the UI will update when I need receive a response in my query.updateHandler. Also if I set it to provide haptic feedback every time my query.updateHandler receives a new HKQuantitySample it will do so, so the app must be running in the background in some form.
Has anyone else noticed this behaviour, and am I doing anything wrong, or expecting something I shouldn't?
Here is how I start my HKWorkoutSession:
self.workoutSession = HKWorkoutSession(activityType: HKWorkoutActivityType.Other, locationType: HKWorkoutSessionLocationType.Indoor)
self.healthStore.startWorkoutSession(self.workoutSession) {
success, error in
if error != nil {
print("startWorkoutSession \(error)\n")
self.printLabel.setText("startWorkoutSession \(error)")
self.printLabel.setTextColor(UIColor.redColor())
}
We're seeing that too, for the moment we've made sure 'opens last activity' is configured.
When the UI is active we start a dispatch_timer to request and process data in 1 second intervals.
Make sure you do any significant processing using the NSUserProcessInfo method though and pause the dispatch_timers whenever you are no longer active. You'll get crashes otherwise.

Resources