4d / 4D-Mobile-App-Server

Open sourced component to install to 4d server as mobile app back end
Other
6 stars 7 forks source link

Clarify when to use which option for instantiating a pushNotification #11

Open macMikey opened 2 years ago

macMikey commented 2 years ago

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.

mesopelagique commented 2 years ago

That's it, you can pass any information that allow to match one app (and its folder) useful only if there is more than one app

The last one is the real one, you ca specify anything for the app folder and p8 key but to keep code simple, we allow to pass the minimum information and we guess the others (like the app and the p8 key path if put in default place)

macMikey commented 2 years ago

Right, I'm just saying that the doc should say exactly that, because it isn't clear until you read the code. When I read the doc, my question was "Wait a second, when do I use each of these?"

mesopelagique commented 2 years ago

If you have only one application in your Session files (MobileApps/), you can call the constructor with no parameter. However, if you have more than one, you will need to provide parameters to identify which application you want to send push notifications to.

I found that sufficient to understand without the code (I do not look at it, that's not mine)