Xamarin.Forms에 응용 프로그램을 빌드 중이며 iOS에 로컬 알림을 표시하는 데 문제가 있습니다. https://developer.xamarin.com/guides/ios/platform_features/user-notifications/enhanced-user-notifications/에서 안내를 따르면서 알림이 표시되지 않습니다. 나는 디스플레이에 통보하고 싶습니다 Xamarin Forms iOS 로컬 알림이 표시되지 않습니다.
UNUserNotificationCenter.Current.RequestAuthorization (UNAuthorizationOptions.Alert, (approved, err) => {});
그리고 내 페이지에서
:using UserNotifications;
var content = new UNMutableNotificationContent();
content.Title = "Notification Title";
content.Subtitle = "Notification Subtitle";
content.Body = "Test Notification.";
content.Badge = 1;
var trigger = UNTimeIntervalNotificationTrigger.CreateTrigger (5, false);
var requestID = "sampleRequest";
var request = UNNotificationRequest.FromIdentifier (requestID, content,
trigger);
UNUserNotificationCenter.Current.AddNotificationRequest (request, (err) => {
if (err != null) {
// Do something with error...
}
});
내 nuGet 패키지의 모든이에게 달려 있습니다 나는 AppDelegate에 내 FinishedLaunching 방법에 다음을 추가했습니다 날짜와 iOS iPhone 시뮬레이터 및 실제 iPad 장치에서 테스트를 시도했습니다.
여기에 누락 된 것이 있습니까?
당신을 감사합니다! 위임자 willPresentNotification을 구현하면 문제가 해결됩니다. – Zithro
다행히 :) –