iOS Question Push Messages to MAC Simulator

roddy

Member
Licensed User
Longtime User
My APP create by B4i v6.80 and the local Mac Builder.

B4J Push Messages.

Compilation is ok, but when I run the App in the Simulator, it displays this fault:

Is there any way to make MAC Simulator receive push ?

B4X:
Copying updated assets files (1)
Application_Start
Application_Active
Application_Inactive
FCMConnected
Application_Pushtoken
PushToken: 0

<B4IExceptionWrapper: Error Domain=NSCocoaErrorDomain Code=3010 "remote notifications are not supported in the simulator" UserInfo={NSLocalizedDescription=remote notifications are not supported in the simulator}>

Application_Active
FCMConnected
 

Semen Matusovskiy

Well-Known Member
Licensed User
I did not try, but https://developer.apple.com/documentation/xcode-release-notes/xcode-11_4-release-notes talks that simulators support pushes since XCode 11.4 (modern release is XCode 12).

Simulator supports simulating remote push notifications, including background content fetch notifications. In Simulator, drag and drop an APNs file onto the target simulator. The file must be a JSON file with a valid Apple Push Notification Service payload, including the “aps” key. It must also contain a top-level “Simulator Target Bundle” with a string value that matches the target application’s bundle identifier.simctl also supports sending simulated push notifications. If the file contains “Simulator Target Bundle” the bundle identifier is not required, otherwise you must provide it as an argument (8164566):

xcrun simctl push <device> com.example.my-app ExamplePush.apns
 
Upvote 0
Top