CKSubscription push notification limits before stop calling didReceiveRemoteNotification - push-notification

I have a CloudKit app on iOS 11.4.1 with frequent record updates through CKSubscriptions. I've found that there's a limit to the # of push notifications received before the device stops receiving any notifications for an extended period (30 mins to 2 hours).
Has anyone encountered this issue? The app is active and receives push notifications from CKSubscriptions just fine, but after 30-40 notifications within the span of 3-5 minutes, it just stops receiving them.
The didReceiveRemoteNotification is not even called. I have the activityIndicator activated during a call. I also call the completionHandler(.newData) for each didReceiveRemoteNotification.
After about 30 mins to 2 hours later (app is always active), didReceiveRemoteNotification starts getting called again with record changes.
Am I approaching some limit for push notifications with CKSubscriptions?
I've thoroughly tested this, and it doesn't have to do with internet connectivity since the device can still send updates to CloudKit, but no push notifications are received.
What I've tried:
1) Throttling my save CKRecords method, so that the records are saved in a batch. Unfortunately, didReceiveRemoteNotification is called once for each record change so same problem.
2) Occurs in both Development and Production (downloaded from App Store) environments
3) abort() and reopening the app doesn't work
4) Tried Apple's CloudShares sample app. I couldn't add many records myself, but when the push notifications were paused on my app, the CloudShares app still received push notifications.
5) Finally, I've tried a counter on the didReceiveRemoteNotification method (without calling any data update methods), and it went to about 80-95 before stopping.
Thanks!

Related

Why does long inactivity break nextj ssr with firestore?

I am learning Firestore and NextJS. In my application I have a server side render page, that queries Firestore. Works fine, but I noticed, that if I am inactive long enough (few minutes), and then load the page (by clicking on a link), the props returned getServerSideProps will be null.
In the logs I see the following:
#firebase/firestore: Firestore (9.6.8): Connection GRPC stream error.
Code: 14 Message: 14 UNAVAILABLE: read ECONNRESET
I need to click the link again and second time it works again.
Anyone knows the reason?

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.

Diagnose message from phone to android dropped due to APP_MSG_BUSY?

I'm trying to send a message from an Android companion app to a Pebble watchface app, but this fails with an APP_MSG_BUSY error. Reading the logs, I can reconstruct the following sequence of events, which is happening repeatedly:
Pebble app calls app_message_outbox_send.
Android companion app receives PebbleDataReceiver.receiveData call.
Android companion app calls PebbleDataReceiver.sendAckToPebble(context, id).
Pebble app receives outbox_sent call.
Android companion app does some work which takes less about 70ms.
Android companion app calls PebbleKit.sendDataToPebble.
Pebble app receives inbox_dropped call with APP_MSG_BUSY.
adb logcat shows the following warnings:
Pbl : [AppMessage] there is not UUID for transactionId : -1
Pbl : [JsInAppMessageHandler] sendAckNackToJs: run: can not send ack message to javascript code because uuid is null
APP_MSG_BUSY suggests there is an incoming or outgoing message in progress. However, you can see from the events above that there is no outgoing message. Also, this is happening for every incoming message, even the first that the Pebble app receives after restarting.
Can anyone offer some insight into what's going on here?
I found my mistake: when I called app_message_open, I passed a value for size_inbound that was too small to receive any of the messages that were being sent. Unfortunately, the AppMessageResult given to my inbox_dropped function wasn't APP_MSG_BUFFER_OVERFLOW as one might expect, but APP_MSG_BUSY.
Now for sheer speculation: what might have exacerbated this was that size_outbound was large enough. In fact, my mistake was swapping the size_inbound and size_outbound arguments. Maybe, by some logic, it didn't make sense to send APP_MSG_BUFFER_OVERFLOW because at least one of the buffers was large enough?

RemotePlaybackClient resume session on Chromecast

I am trying to use the RemotePlaybackClient to resume a Chromecast session created by the same Android app. I'm able to use this RPC vs the full Cast SDK to play, pause, resume, seek, and stop playback on the Chromecast device. My current test is in closing the Android app and using the sessionId from the session to try to reload the app and resume control of the playback. Upon closing the Android app, we are not terminating playback or the session, it keeps going.
Here is the code I'm using:
// attempt resume
mRemotePlaybackClient = new RemotePlaybackClient(getApplicationContext(), ccRoute);
// ccRoute is the selected ChromeCast RouteInfo device - same as previous
System.out.println(mRemotePlaybackClient.isSessionManagementSupported()); // true
System.out.println(mRemotePlaybackClient.hasSession()); // false
mRemotePlaybackClient.setSessionId(saved_sessionId); // saved_sessionId is the sessionId saved from the mRemotePlaybackClient.play command in success reply.
System.out.println(mRemotePlaybackClient.hasSession()); // true
mRemotePlaybackClient.startSession(null, ccStart); // callback returns error 0
mRemotePlaybackClient.setStatusCallback(ccSessionStatus); // callback returns error 0
I've asked some others familiar with the RemotePlaybackClient and the Chromecast, including those within Google but did not get an answer. Also, I seem to be seeing some of the same issues #Commonsware is seeing in that some callbacks don't reply at all. In addition, with images, metadata is not returned and the status callback returns an error whereas video returns ok (position info etc).
Really, I'd just like to resume the session for now vs having to wire up the full Cast SDK.

Unable to Receive Pushes in client application after Registration in BB10 Webworks

My question is similar to BlackBerry push client application subscription but still i have doubts in that ..plz clarify.My doubt is When i tried with sample Push Initiator which comes with Push SDK and Sample Push-enabled application[Push Capture] from github i can Receive Pushes in that sample application.But when i try the same logic in My own client application i am not receiving Pushes..
Steps I followed:
Registered with Push service and got Confirmation mail with AppID,Password and PPG url.
With those details i set to receive Pushes like:Called the create function and createChannel,success callback was called and it returned device token also.
But still i am not receiving Pushes in my application.Plz help where i am lagging.
Question:
How Pushes differentiate the client app and devices while sending Pushes.
NOTE:i used the same AppID which i used for sample app.
when i called create function and createChannel,success callback was called and it returned device token also. When i received Push,onInvoke event was called and action was bb.action.PUSH which denotes we received a Push..Since i didnot add Notifications to Hub i didnot recognize previously.
Also we cannot use same AppID for different applications.It will create problem

Resources