A simple MacOS application that can send a push notification to the iOS Simulator
You need Xcode 11.4 or above. This application uses the new simctl
command to make this possible .
Make sure that your application have the following code:
var notificationCenter = UNUserNotificationCenter.Current;
notificationCenter.RequestAuthorization (UNAuthorizationOptions.Alert | UNAuthorizationOptions.Sound, IsGranted);
void IsGranted (bool granted, NSError error)
{
if (granted) {
Console.WriteLine ("The simulator can now receive push notifications");
}
}
let notificationCenter = UNUserNotificationCenter.current()
notificationCenter.requestAuthorization(options: [.alert, .sound]) { granted, error in
// If `granted` is `true`, the simulator can now receive push notifications!!
}
This project is licensed under the MIT License - see the LICENSE.md file for details.