-
Notifications
You must be signed in to change notification settings - Fork 43
Swift trampoline fixes #448
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
base: master
Are you sure you want to change the base?
Changes from all commits
6741609
f6fa2c5
9a39be1
dd4f1d0
f54ff08
b6e4e9d
e00f0a4
9481777
19e4ad4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| test_editors: | ||
| - version: trunk | ||
| - version: 6000.6 | ||
| - version: 6000.5 | ||
| - version: 6000.4 | ||
| - version: 6000.3 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #if UNITY_XCODE_PROJECT_TYPE_SWIFT | ||
|
|
||
| import Foundation | ||
|
|
||
| @_cdecl("UnityMobileNotifications_applicationWillFinishLaunchingName") | ||
| func applicationWillFinishLaunchingName() -> Notification.Name { | ||
| UnityNotifications.applicationWillFinishLaunching | ||
| } | ||
|
|
||
| @_cdecl("UnityMobileNotifications_applicationDidRegisterForRemoteNotificationsName") | ||
| func applicationDidRegisterForRemoteNotificationsName() -> Notification.Name { | ||
| UnityNotifications.applicationDidRegisterForRemoteNotifications | ||
| } | ||
|
|
||
| @_cdecl("UnityMobileNotifications_applicationDidFailToRegisterForRemoteNotificationsName") | ||
| func applicationDidFailToRegisterForRemoteNotificationsName() -> Notification.Name { | ||
| UnityNotifications.applicationDidFailToRegisterForRemoteNotifications | ||
| } | ||
|
|
||
| @_cdecl("UnityMobileNotifications_remoteNotificationsDeviceTokenKey") | ||
| func remoteNotificationsDeviceTokenKey() -> NSString { | ||
| UnityNotifications.remoteNotificationsDeviceTokenKey as NSString | ||
| } | ||
|
|
||
| #endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,10 +10,16 @@ | |
| #import "UnityNotificationManager.h" | ||
|
|
||
| #if UNITY_XCODE_PROJECT_TYPE_SWIFT | ||
| #import "UnityFramework/UnityFramework-Swift.h" | ||
| #define kUnityWillFinishLaunchingWithOptions UnityNotifications.applicationWillFinishLaunching | ||
| #define kUnityDidRegisterForRemoteNotificationsWithDeviceToken UnityNotifications.applicationDidRegisterForRemoteNotifications | ||
| #define kUnityDidFailToRegisterForRemoteNotificationsWithError UnityNotifications.applicationDidFailToRegisterForRemoteNotifications | ||
| extern "C" | ||
| { | ||
| NSNotificationName UnityMobileNotifications_applicationWillFinishLaunchingName(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't you #import UnityAPI or UnityFramework to see UnityNotifications interface here?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. UnityAPI does not exist in 6.6 and 6.5 and it is the one you have to import in trunk. We don't have version handling yet, so I can make it work with older or newer, not both. |
||
| NSNotificationName UnityMobileNotifications_applicationDidRegisterForRemoteNotificationsName(); | ||
| NSNotificationName UnityMobileNotifications_applicationDidFailToRegisterForRemoteNotificationsName(); | ||
| NSString* UnityMobileNotifications_remoteNotificationsDeviceTokenKey(); | ||
| } | ||
| #define kUnityWillFinishLaunchingWithOptions UnityMobileNotifications_applicationWillFinishLaunchingName() | ||
| #define kUnityDidRegisterForRemoteNotificationsWithDeviceToken UnityMobileNotifications_applicationDidRegisterForRemoteNotificationsName() | ||
| #define kUnityDidFailToRegisterForRemoteNotificationsWithError UnityMobileNotifications_applicationDidFailToRegisterForRemoteNotificationsName() | ||
| #else | ||
| #import "Classes/PluginBase/AppDelegateListener.h" | ||
| #endif | ||
|
|
@@ -104,7 +110,7 @@ + (NSData*)deviceTokenFromNotification:(NSNotification*)notification | |
| NSData* deviceToken = nil; | ||
|
|
||
| #if UNITY_XCODE_PROJECT_TYPE_SWIFT | ||
| id token = [notification.userInfo objectForKey: UnityNotifications.remoteNotificationsDeviceTokenKey]; | ||
| id token = [notification.userInfo objectForKey: UnityMobileNotifications_remoteNotificationsDeviceTokenKey()]; | ||
| #else | ||
| id token = notification.userInfo; | ||
| #endif | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.