Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] MSInstallationLifecycleDelegate and MSInstallationEnrichmentDelegate are not work. #128

Open
3 tasks
muak opened this issue Feb 28, 2022 · 0 comments
Open
3 tasks

Comments

@muak
Copy link

muak commented Feb 28, 2022

Describe the bug
MSInstallationLifecycleDelegate and MSInstallationEnrichmentDelegate method are not called.
RegisteredForRemoteNotifications is called correctly.

Exception or Stack Trace

To Reproduce

Code Snippet

    public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate, IUNUserNotificationCenterDelegate
    {        
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {            
            global::Xamarin.Forms.Forms.Init();
            
            UNUserNotificationCenter.Current.Delegate = this;            
            
            LoadApplication(new App());

            
            MSNotificationHub.SetDelegate(new AzureNotificationHubListener());
            MSNotificationHub.SetLifecycleDelegate(new AzureInstallationLifecycleListener());
            MSNotificationHub.SetEnrichmentDelegate(new AzureInstallationEnrichmentListener());
            MSNotificationHub.Start(Constants.NotificationHubUrl, Constants.NotificationHubName);
            
            return base.FinishedLaunching(app, options);
        }

        public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        {
             // This method is called correctlly.
        }

        public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
        {
            ;
        }

    public class AzureNotificationHubListener : MSNotificationHubDelegate
    {
        public override void DidReceivePushNotification(MSNotificationHub notificationHub, MSNotificationHubMessage message)
        {
            // This method is called correctlly.
        }
    }

    public class AzureInstallationLifecycleListener : MSInstallationLifecycleDelegate
    {
        public override void DidFailToSaveInstallation(MSNotificationHub notificationHub, MSInstallation installation, NSError error)
        {
            ;
        }

        public override void DidSaveInstallation(MSNotificationHub notificationHub, MSInstallation installation)
        {
            // This method is not called.
        }
    }

    public class AzureInstallationEnrichmentListener : MSInstallationEnrichmentDelegate
    {
        public override void WillEnrichInstallation(MSNotificationHub notificationHub, MSInstallation installation)
        {
            // This method is not called.
        }
    }

Expected behavior

DidSaveInstallation and WillEnrichInstallation are called.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [iOS 14.7.1]
  • IDE : [Xcode 13.2.1][VS for Mac 8.10.19]
  • Version of the Library used [3.1.1]
  • Xamarin.Forms version 5.0.0.2337

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant