Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
It would be extremely useful if there were some events that can currently be overridden in the UIApplicationDelegate as methods.
Here's the additions I'd like to see:
UIApplication.SharedApplication.OnRegisteredForRemoteNotifications(UIApplication app, NSData deviceToken);
UIApplication.SharedApplication.OnFailedToRegisterForRemoteNotifications(UIApplication app, NSError error);
UIApplication.SharedApplication.ReceivedRemoteNotification(UIApplication app, NSDictionary userInfo);
These events should be fired whether or not the methods have been overridden in the AppDelegate.
SharedApplication might not be the right spot for this, but what I'm getting at is needing a way to know these things have happened without being the delegate.
The main use case I have for this right now is trying to make an abstract 'client' library for PushSharp. Currently, it would require users of the library to use my own implementation of UIApplicationDelegate. This may be ok for some, but once you start using things like MvvmCross, etc., you would be competing for which implementation of UIApplicationDelegate to use...
Is this a possibility, or anything similar?
Not sure why I didn't think of this earlier, but perhaps an easier way would be for MonoTouch to under the hood post a notification to the NSNotificationCenter.DefaultCenter with a particular name... eg:
This way the notifications could be easily consumed by any library, including a PushSharp client...
The way this works is to subscribe to the notification you want to hear about, but we "Xamarin.iOS" have no reason to fire these events ourselves so we can't really bake this on our side