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

RegisteredForRemoteNotifications override not being called, ever #10742

Closed
CMarcher opened this issue Feb 27, 2021 · 2 comments
Closed

RegisteredForRemoteNotifications override not being called, ever #10742

CMarcher opened this issue Feb 27, 2021 · 2 comments

Comments

@CMarcher
Copy link

Steps to Reproduce

  1. On the Apple Developer console, create an app id with Push Notifications enabled, and then edit the Push Notifications section to create a development APNs certificate. Create a provisioning profile with that app id, install on your system or download from the Apple Account sections under Preferences.
  2. Add "com.apple.developer.aps-environment" to Entitlements, and set the value to "development".
  3. In the AppDelegate, under FinishedLaunching, add this code before base.DidFinishLaunching is called:
var app = NSApplication.SharedApplication;
app.RegisterForRemoteNotifications();
app.RegisterForRemoteNotificationTypes(NSRemoteNotificationType.Badge);
  1. Add an override for RegisteredForRemoteNotifications in the AppDelegate. Add something like Debug.WriteLine("This function has been called."); inside. Add a breakpoint if you'd like.
  2. Run the app.

Expected Behavior

RegisteredForRemoteNotifications override is called.

Actual Behavior

RegisteredForRemoteNotifications is not called, therefore I cannot set up the notification server.

Environment

=== Visual Studio Community 2019 for Mac ===

Version 8.8.10 (build 2)
Installation UUID: d7bdbec6-b34c-4d80-ba0e-0be0e59dff33
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000122

=== Mono Framework MDK ===

Runtime:
	Mono 6.12.0.122 (2020-02/c621c35ffa0) (64-bit)
	Package version: 612000122

=== Roslyn (Language Service) ===

3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.103/Sdks
SDK Versions:
	5.0.103
	3.1.406
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	5.0.3
	3.1.12

=== .NET Core 3.1 SDK ===

SDK: 3.1.406

=== Xamarin.Profiler ===

Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Xamarin.Android ===

Version: 11.1.0.26 (Visual Studio Community)
Commit: xamarin-android/d16-8/a36ce73
Android SDK: /Users/calebarcher/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		None installed

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 29.0.2

Build Information: 
Mono: 5e9cb6d
Java.Interop: xamarin/java.interop/d16-8@79d9533
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/calebarcher/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.8.0.32
Hash: 01a7774
Branch: remotes/origin/d16-8
Build date: 2021-01-14 00:34:58 UTC

=== Android Device Manager ===

Version: 16.8.0.46
Hash: 0a81419
Branch: remotes/origin/d16-8
Build date: 2021-01-14 00:35:22 UTC

=== Apple Developer Tools ===

Xcode 12.4 (17801)
Build 12D4e

=== Xamarin.Mac ===

Version: 7.4.0.10 (Visual Studio Community)
Hash: a4c70e7d0
Branch: xcode12.4
Build date: 2021-02-17 17:40:51-0500

=== Xamarin.iOS ===

Version: 14.10.0.4 (Visual Studio Community)
Hash: 5a05865f6
Branch: xcode12.4
Build date: 2021-01-28 02:30:23-0500

=== Xamarin Designer ===

Version: 16.8.0.510
Hash: 44e3f3ce9
Branch: remotes/origin/d16-8
Build date: 2020-12-10 00:06:14 UTC

=== Build Information ===

Release ID: 808100002
Git revision: f81ffa2444a28c09f173849935ec9ee0195a5b17
Build date: 2021-02-18 12:02:12-05
Build branch: release-8.8
Xamarin extensions: f81ffa2444a28c09f173849935ec9ee0195a5b17

=== Operating System ===

Mac OS X 10.16.0 (not a part of the log, but my actual version number is 11.2.1)
Darwin 20.3.0 Darwin Kernel Version 20.3.0
    Thu Jan 21 00:07:06 PST 2021
    root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64


@CMarcher
Copy link
Author

I'm currently on Big Sur, and I found this.

It seems notifications work pre-Big Sur for development environments, but with Big Sur this is no longer true. Production is supposedly unaffected.

@CMarcher
Copy link
Author

After changing the environment to production and signing with a production provisioning profile, I can confirm that Big Sur is the issue, as the override is being reached now. This is an Apple issue, not something that can be fixed here.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant