Custom notifications for multiplayer invitation - google-play-services

I'm looking for a way to customize default notifications that player receives from friend or other player. Currently there are only default notifications.

You must implement
com.google.android.gms.games.multiplayer.OnInvitationReceivedListener.
Then you have to override onInvitationReceived to display a custom notification when you receieve an invitation.
It's just that simple. Any other questions don't hesitate to ask :)

Related

Notification Handling with PushIOManager

I have implemented the notifications on iOS and Android using PushIOManager. I get the notification in devices.
Now when I click on notification I am not getting any event from which we can move on particular screen or we need to perform some task on that.
I have tried with onNotificationOpenedApp() and getInitialNotification() which is firebase/messaging method but it is not called when I click on notification.
Can anyone please let me know which method is used for the same?
Thanks in advance

Is it possible for macOS to handle a scheduled local notification?

Please note that I am referring to macOS, and to scheduled local notifications. I want for the application to be able to handle when the notification is presented, not when the user actually taps the notification.
UNUserNotificationCenterDelegate has methods for handling a notification when the app is in the foreground:
https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate/1649518-usernotificationcenter?language=objc
However it appears there is no way to handle one that is presented when the application is in the background
Any ideas on how to do this?

Cocoa / NSUserNotificationCenter get all NSUserNotification notifications

How can I be notified whenever any application delivers or activates an NSUserNotification?
Neither could I determine anything that is sent via NSDistributedNotificationCenter,
nor could I find a mask like NSUserNotificationDeliveredMask [dummy name] I could register a global [NSEvent addGlobalMonitorForEventsMatchingMask] for,
nor does there seem to be a suitable observer for the default user notification center object.
The [NSUserNotificationCenter defaultCenter] and its delegate only notify me when my own app delivers a notification.
This answer should address how to receive available notifications from NSDistributedNotificationCenter. There doesn't seem to be any way to get all NSUsernotifications as far as I know, though.
It is not possible. You can only listen to NSDistributedNotificationCenter for "global" notifications. The app developer has to broadcast to NSDistributedNotificationCenter for you to hook into it.
You can't hijack other applications Notifications. Most apps and all apps distributed through App Store is sandboxed. The very nature of this limits your ability to hook into them!

iOS – How to deal with notifications when I have no "control" of the GUI

I'm using Apple's view controllers quite alot in my app (like MFMessageComposeViewController and ABPeoplePickerNavigationController). So when I receive a notification (Local or Remote notification) how would I deal with it the most elegant way since I can not interact (send messages) to Apple's view controllers.
My assumption is that if the user is actively using the app and in i.e MFMessageComposeViewController he does not want to get disturbed/interrupted with what he is doing. But if it was me I would get a bit confused if I was doing something and I would hear boing sound (from the notification) and then nothing more happened.
So would a reasonable way to handle this do let the user finish doing his task in whatever Apple view controller he is inside and then display the notification for the user?
Or dismiss the Apple view controller and handle the notifaction and then put the user back in the Apple view controller?
I'm not quite sure I understood you exactly correct, but to me it sound like you want to do something like this:
If the user is composing a message in your app and there is an incoming notification, lets say a push notification from the facebook app, you want to handle this event somehow in your app by letting your MFMessageComposerViewController do something.
As answer to this request I would like to state the following:
You should be able to send messages to your MFMessageComposerViewController if you extend this class (i.e. create a class called MyMessageComposerController and let it extend the standard controller, and do whatever you need there)
However, you can't really do anything about the push notification, it comes from another app and this functionality is built into iOS, you can not make the push arrive later when the user is finished typing, it will always arrive and the user will always be the one to decide if he/she should keep typing or look at the notification. The only thing you can do is to make sure that your app saves everything that the user has typed so that he/she can continue typing when returning to your app.
Assuming you don't just want to display an AlertView or something similarly modal over the message composer, I would do something like the following:
assign a MFMessageComposeViewControllerDelegate to the composer.
show the composer as usual.
queue/remember the notifications received while the composer is in play (through the normal application:didReceive{Local|Remote}Notification: messages)
when the composer is closed, the delegate receives its messageComposeViewController:didFinishWithResult: message.
Do... whatever... with the stored/queued notifications.
Whether you delay responding to the notification until the user is finished with the composition or interrupt them is a trickier situation. If it's a relatively unimportant notification or notifications that are frequent, I'd tend towards the queue/delay approach. But for "important" notifications, I'd have no problems in interrupting the user. Of course, that just moves the question to what determines importance. And that is very much dependent on the app.

Override / cancel iPad application switch gesture

I want to track four finger touches in my application, but they are cancelled as the iPad uses the four finger swipe to switch applications.
Is there a way to cancel / override this gesture?
I looked into this for a game I worked on and I could not find a way to override it. Even if you found a way, it would probably get you rejected from the app store, since there doesn't seem to be any public API for it.
This be my answer. I'm not sure how you'd go about to actually execute the below as I guess implementions do things differently, but generally it sounds as there is a possibility, because after all these are the words of Apple regarding the multitasking gestures:
"Developers are encouraged to evaluate any existing interactions in
their applications for potential sources of interference. In order to
properly interoperate with multitasking gestures, applications must
properly handle the following methods and notifications:
touchesCancelled:withEvent: (UIResponder) cancelTrackingWithEvent:
(UIControl) applicationDidBecomeActive: and
applicationWillResignActive: (application delegate)
UIApplicationDidBecomeActiveNotification and
UIApplicationWillResignActiveNotification notifications These can be
enabled for development via Xcode so you can update your apps to
interoperate with these new gestures. Test them and give us your
feedback in the Apple Developer Forums."
I really don't think you can because I have watched countless videos on how to override on iPhone/iPod but there are no ones for iPad must be so you can't cheat on games!