locked
MobileServiceClient.GetPush().RegisterAsync( deviceToken ) returns a 404 Error RRS feed

  • Question

  • Application: Xamarin.iOS application

    My Mobile service client has suddenly started returning an HTTP 404 error whenever RegisterAsync is called. This previously worked, and no change has been made to the settings. No changes have been made to the associated notification hub, nor to the registered notifications.

    C# code from AppDelegate:

    public override async void RegisteredForRemoteNotifications( UIApplication application, NSData deviceToken )
    {
      string installationId;
      var client = new MobileServiceClient( "My web app url" );
      var push = client.GetPush();
    
      try
      {
         installationId = await push.RegisterAsync( deviceToken );
      }
      catch ( Exception ex )
      {
         // Always hits here with a 404 exception
      }
    
      /.../
    }

    I added a logger to the client and it is returning the following.

    Request:
    PUT /push/installations/279144b3-2904-45e2-9039-44f4287f71b1 HTTP/1.1
    Host: <My Mobile Service>

    {
    "pushChannel": "E48711E24D007620E49B6561E2EA19A25627450F3469EBBAC9CC4435EC0B4BC4",
    "platform": "apns"
    }

    Response:

    HTTP/1.1 404 Not Found


    What else can I do to troubleshoot this? I'm concerned that this could occur in production, which would not be ideal.



    Tuesday, December 11, 2018 4:41 PM

Answers

  • The hotfix has been deployed for this globally. A restart of the application should cause the application to pick up the newer version of the Push Notification code, and it should begin working as normal.
    Thursday, December 20, 2018 6:58 PM

All replies

  • Can you please enable the web server logs under the diagnostic blade of you app and observe the full HTTP error code in the logs?

    We are looking for the sc_status and sc_substatus. This will help us to better understand the nature of the HTTP 404 error as these can be generated for a number of reasons.

    Saturday, December 15, 2018 2:33 AM
  • Hi, I have the same issue and in my case  for a request "PUT /push/installations" I receive a 404 error with sc-status="0" and sc-substatus = "2".

    Thanks.

    Enrico.

    Monday, December 17, 2018 2:21 PM
  • Hi all,

    the very same happens to me all day long (in production) as well. Already registered devices/installations still reveive their push notifications properly, but can't register any new ones.

    Code snippet (tried both versions) to do this (Xamarin.Forms project):

    var recordedInstallation = await client.InvokeApiAsync<DeviceInstallation, DeviceInstallation>(
                            $"/push/installations/{client.InstallationId}",
                            installation,
                            HttpMethod.Put,
                            new Dictionary<string, string>());
                        System.Diagnostics.Debug.WriteLine("Completed NH Push Installation");

    --or--

    const string templateBodyAPNS = "{\"aps\":{\"alert\":\"$(messageParam)\"}}";

                        JObject templates = new JObject
                        {
                            ["genericMessage"] = new JObject
                        {
                            {"body", templateBodyAPNS}
                        }
                        };

                        Push push = client.GetPush();
                        await push.RegisterAsync(AppDelegate.PushDeviceToken, templates);

    Checked with POSTMAN and debugged, re-deployed my MobileApps Backend but nothing will fix this as it seems :-/

    Returns HTTP 404 - The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    ZUMO/4.1+(lang=Managed;+os=iOS;+os_version=12.1.1;+arch=MacOSX;+version=4.1.1.0) - - {URL WAS HERE} 404 0 2 420 1795 46

    Is this something that can be corrected by changing the Mobile Apps config or so?

    Thanks in advance - help is highly appreciated.

    BR,

    Marco


    • Edited by Marco Smetz Monday, December 17, 2018 6:29 PM
    Monday, December 17, 2018 5:46 PM
  • Hi Marco,

    I've also tested with InvokeApiSync and RegisterAsync; same identical issue as for yr message error.

    I've re-deployed the App Service backend  and configured a new NotificationHub; same issue.

    Best Regards,

    Enrico.

    Monday, December 17, 2018 7:12 PM
  • Hi Marco,

    I've also tested with InvokeApiSync and RegisterAsync; same identical issue as for yr message error.

    I've re-deployed the App Service backend  and configured a new NotificationHub; same issue.

    Best Regards,

    Enrico.

    Updated to latest NuGet packages for MobileApps Packages but made no difference. The tables endpoint still works fine - same with my CustomAPI. But the push endpoint seems gone and I, so far, did not find out where it actually comes from and if I can do anything about it. Like you, it worked fine and aparently just stopped working. I did not notice until now since existing registrations still got their Notifications - like me until I uninstalled my App and after a reinstall it started throwing these registration errors.

    Hopefully anybody can give a hint here or I'll find out where to (re-)configure it in my Mobile Backend.

    Tuesday, December 18, 2018 4:47 AM
  • Hello All,

    We wanted to share with you that this is a known issue at this time. The product group is working on a hotfix and hope to have a resolution deployed soon. We will provide you with updates as we receive them.

    We apologize for the frustration that this has caused you and thank you for your patience.

    Tuesday, December 18, 2018 11:14 PM
  • Wow, I've been hammering my head on this for the past 3 days! I kept wondering why our iOS app in the store decided to crash during launch. I hope this gets fixed soon, getting lots of unhappy users and bad app reviews :(
    Wednesday, December 19, 2018 12:46 AM
  • Hello Bryan, 

    It seems to be working again. Can you confirm?

    Thursday, December 20, 2018 5:47 PM
  • The hotfix has been deployed for this globally. A restart of the application should cause the application to pick up the newer version of the Push Notification code, and it should begin working as normal.
    Thursday, December 20, 2018 6:58 PM
  • The hotfix has been deployed for this globally. A restart of the application should cause the application to pick up the newer version of the Push Notification code, and it should begin working as normal.

    Can report it is working again! Thank you very much for the fast fix turnaround - this is highly appreciated!

    BR,

    Marco

    Friday, December 21, 2018 5:40 AM
  • Hi,

    I confirm that the issue has been resolved.

    Thanks for yr help.

    Best regards,

    Enrico.

    Friday, December 21, 2018 8:19 AM
  • Hi,

    Is there a possibility that this bug resurfaced again?

    At least two weeks ago, the registration worked fine. But since today, when we started testing again it seems to always return the exception earlier mentioned in this thread: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient Since it actually worked at least 2 weeks ago, and we did not change any code related to this, could it be that the bug slipped in again? Since previous the fix was released in December 2018, we should already have this fix running on our server. Best regards,

    Henk-Martijn Leidelmeijer

    Monday, February 11, 2019 3:18 PM
  • I am suddenly seeing this again also. I restarted the application, but the problem persists.
    Wednesday, February 13, 2019 5:45 AM