4d / 4d-mobile-app-server Goto Github PK
View Code? Open in Web Editor NEWOpen sourced component to install to 4d server as mobile app back end
License: Other
Open sourced component to install to 4d server as mobile app back end
License: Other
In the Instanciate the PushNotification class docs, several methods are mentioned:
Only none has an explanation as to why you would use it - namely, you only have one application folder in your MobileApps folder.
That leaves unanswered what differentiates the others.
It does not seem that they are different from each other, that they are all just different ways of matching the same folder names.
if there is duplicate in email for push notification, could we remove it?
(maybe not if we found it by device them if too difficult, but if explicitly specify in email collection list)
ps: task to not forget
Push is device-dependent, but sometime after b27545f (I have not dug into the code to discover where, yet), it became email-dependent. This might be fine for cases where only a personal device is being used, but it does not work at all for kiosks, where multiple people use the same device and the same person can be on multiple devices throughout the day.
In our case, we have the devices named, but the push code is now rejecting device names that are not email addresses.
In the docs for push notifications, I see several parameters/properties that are implemented but undocumented:
badge
sound
mutable-content
category
url
data
Is there a reason for that, or can I work on adding them?
If, instead of sending email addresses to pushNotification.send I send device tokens, I will receive an error back for every device, saying that I didn't pass an email address.
That is not helpful, since sending device tokens is specifically mentioned as legitimate in the docs.
Sometime after b27545f (I have not read through the code to see where, yet), push .sendAll can both set success to true while returning both errors and warnings, and the notification failing.
The docs describe and the code includes support for a subtitle property. However Apple's Docs does not mention it, and if I try to use it, the message does not make it to the device. Removing the key lets the message go.
class PushNotification.send calls Mobile App Push Notification which calls apple_sendNotification.
In line 38-42 we have
If (Length($cmdPush_err)>0)
LOG EVENT(Into 4D debug message; $cmdPush_err)
End if
but, we don't return $cmdPush_err up the chain, so the PushNotification.result property is never set with the error, etc.
I ran into this issue, today. I got warnings, including a warning that a push notification was not sent (but no error), and I did not get a reason returned, either.
use 4D.File
and 4D.Folder
instead
https://github.com/4d/4D-Mobile-App-Server/blob/main/Project/Sources/Classes/Session.4dm#L27
https://github.com/4d/4D-Mobile-App-Server/blob/main/Project/Sources/Methods/MOBILE%20APP%20Get%20all%20bundleIds.4dm#L31
https://github.com/4d/4D-Mobile-App-Server/blob/main/Project/Sources/Methods/test_pushnotification.4dm#L15
https://github.com/4d/4D-Mobile-App-Server/blob/main/Project/Sources/Methods/test_session.4dm#L9
https://github.com/4d/4D-Mobile-App-Server/blob/main/Project/Sources/Methods/MOBILE%20APP%20Get%20all%20deviceTokens.4dm#L28
https://github.com/4d/4D-Mobile-App-Server/blob/main/Project/Sources/Methods/MA%20Get%20all%20mailAddresses.4dm#L28
https://github.com/4d/4D-Mobile-App-Server/blob/main/Project/Sources/Methods/MOBILE%20APP%20Get%20session%20info.4dm#L31
The following code will not set the badge of a mobile app:
$notification:=New object()
$notification.title:="test title"
$notification.badge:=1
Inside of project method buildNotification on line 51, the value type of badge is evaluated:
If (Value type($1.badge)=Is integer)
Even the literal 1 evaluates to Is real in this code.
I tried a variety of workarounds to resolve this issue, including
$notification.badge:=Int(1)
but none of the things I have tried have worked.
The code does allow the developer to manually build a push notification using the userInfo object, however it cannot be used to supplement the other settings (like title and body, as it will overwrite other properties, so you cannot, for example use
$notification.title:="TEST PUSH"
$notification.userInfo.aps.badge:=1
because even though $notification.aps.title is initially set, using userInfo.aps will cause the code to wipe the other properties of aps instead of appending the aps.badge property.
However, you can build the entire aps object using this technique:
$notification.userInfo.aps.alert.title:="TEST PUSH"
$notification.userInfo.aps.alert.subtitle:="Test Subtitle"
$notification.userInfo.aps.alert.body:="test body"
$notification.userInfo.aps.badge:=1
In the buildNotification project method:
$notification.aps.badge:=Int($1.badge)
$key
and inserts $1.userInfo[$key]
but does not wipe any existing property or object. This would make the code more future-proof since Apple is likely to modify the APNS Dictionary and Alert keys in the future.I had a session file that got corrupted, but I didn't know it. Opening the project resulted in an unhelpful error message.
It would be great if when a file gets borked, the report includes the name of the file, and the fact that the mobile app server is the component reporting the issue.
It took hours to finally figure out what the problem was.
-mais une fois une app ios generé (et un team id remlpli = myteamidios) on se retrouve avec "package_name": "myteamidios.com.myapp.test" donc univesal links ne marche plus sur android
(Actuellement on a opté pour une solution provisoire : utliser app.application.id au lieu de app.id )
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.