KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Mobile App Server Push Notification “Session constructor” error
PRODUCT: 4D for iOS | VERSION: 18 R | PLATFORM: Mac
Published On: April 19, 2021

When testing the push notification feature in 4D for iOS, you may come across this error:



This error means that you are trying to instantiate the PushNotification class without specifying the application to which you want to send push notifications. In your push notification code, you have something like this:

$pushNotification:=MobileAppServer.PushNotification.new()

But in your MobileApps folder, you have several application folders:



An application folder is generated each time the mobile app is built after editing the identifier, app name, or team ID in the General section. If only have one application folder, you can call the PushNotification constructor without any parameters. However, if you have multiple application folders, you must specify the application in the parameter. For example:


$pushNotification:=MobileAppServer.PushNotification.new(“MY_TEAM_ID.com.myCompany.My-App2”)