× Requests and support related to jBackend.

Apple APNS: Sandbox/Live support? ssl certificate format?

  • phuture
  • phuture's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago #6128 by phuture
I've previously implemented APNS on an iOS App but this is my first time attempting it with JBackend.
I've got 2 questions so far.

1) In creating an App entry what format do you expect the "SSL certificate" to be?
In my previous implementation I'd convert the ,p12 certificate file to a .pem file using the command line "openssl pkcs12 -in cert.p12 -out ck.pem -nodes -clcerts"

2) I created 2 App's for my App, one Live and the other Sandbox. Then I discovered, in the Plugin "jBackend - Push Notifications" configuration under iOS tab, the APNs URL which was filled in with Apple's live url "ssl://gateway.push.apple.com:2195".
Would it be possible, in future updates, to include both live and sandbox? Sandbox url is "ssl://gateway.sandbox.push.apple.com:2195"
Then in the App configuration have a boolean switch for indicating if that appcode uses the live or sandbox APNS system?

Thanks,
George

PS
Love JBackend. It very very well written and documented. I real pleasure to use. I've left a review on joomla extensions.

Please Log in or Create an account to join the conversation.

  • phuture
  • phuture's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago #6129 by phuture
Also - Just spotted this PHP error in the logs:

PHP Notice: Undefined index: target_groups in /var/www/website/administrator/components/com_jbackend/controllers/notification.php on line 36, referer: mywebsite.com/administrator/index.php?option=com_jbackend&view=notification&layout=edit&id=1

Please Log in or Create an account to join the conversation.

  • phuture
  • phuture's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago #6131 by phuture
I've kind of got this working but with some more issues.

1) "Platform Type". I assumed (wrongly) that "Generic" meant any platform. I have only 1 registered, iOS, device for testing and if I create a notification to test it, it doesn't get sent if I have generic selected as the platform.
I have to specifically state "iOS" as the platform and then it works fine.
This doesn't work well as jBackend should, I think, be abstracting the notifications and hardware. The software sending user notification shouldn't need to know what platform type the user is using.

2) I don't understand why the programmatical creation of notifications needs to be via the REST API?
Why is there no direct JPluginHelper / JDispatcher ->trigger support?
I've written my own into my custom jbackend plugin for notifying a single user which works ok with the exception of (1) above. I would have expected this to be part of the standard package though?

3) My Joomla installation just notified me of a JBackend update 3.3.0 -> 3.5.0 which I tried to install but it failed with errors.
"Warning - Update path does not exist. "
"Message - Error updating COM_INSTALLER_TYPE_TYPE_."
"Notice - Before updating ensure that the update is compatible with your Joomla! installation."

Please Log in or Create an account to join the conversation.

More
7 years 6 months ago - 7 years 6 months ago #6134 by admin
Hi George,
a lot of questions here, so let's start:

1) In creating an App entry what format do you expect the "SSL certificate" to be?
In my previous implementation I'd convert the ,p12 certificate file to a .pem file using the command line "openssl pkcs12 -in cert.p12 -out ck.pem -nodes -clcerts"


Format is PEM:
www.selfget.com/documentation/jbackend-joomla30/apps.html

2) I created 2 App's for my App, one Live and the other Sandbox. Then I discovered, in the Plugin "jBackend - Push Notifications" configuration under iOS tab, the APNs URL which was filled in with Apple's live url "ssl://gateway.push.apple.com:2195".
Would it be possible, in future updates, to include both live and sandbox? Sandbox url is "ssl://gateway.sandbox.push.apple.com:2195"
Then in the App configuration have a boolean switch for indicating if that appcode uses the live or sandbox APNS system?


Good tip, added to my todo list for the next version.

PHP Notice: Undefined index: target_groups in /var/www/website/administrator/components/com_jbackend/controllers/notification.php on line 36, referer: mywebsite.com/administrator/index.php?option=com_jbackend&view=notification&layout=edit&id=1


I think I have already fixed this in the 3.5.0 if I remember it well, but I will double check it, thanks.

1) "Platform Type". I assumed (wrongly) that "Generic" meant any platform. I have only 1 registered, iOS, device for testing and if I create a notification to test it, it doesn't get sent if I have generic selected as the platform.
I have to specifically state "iOS" as the platform and then it works fine.
This doesn't work well as jBackend should, I think, be abstracting the notifications and hardware. The software sending user notification shouldn't need to know what platform type the user is using.


No, generic is a kind of "default" value that could be useful in the next future (e.g. web push).

2) I don't understand why the programmatical creation of notifications needs to be via the REST API?
Why is there no direct JPluginHelper / JDispatcher ->trigger support?
I've written my own into my custom jbackend plugin for notifying a single user which works ok with the exception of (1) above. I would have expected this to be part of the standard package though?


No, there is and I already use it for my customers, but probably I should document it in the developer section. If you look at the helper.php on the site part (not admin) you will find a well documented function to create and add notifications to queue programmatically. This is the most flexible way to provide this feature to any developer for me. I have already used it to create push, as example, when a type of content is added, when a balance entry is created, when a form is compiled, and so on...

3) My Joomla installation just notified me of a JBackend update 3.3.0 -> 3.5.0 which I tried to install but it failed with errors.
"Warning - Update path does not exist. "
"Message - Error updating COM_INSTALLER_TYPE_TYPE_."
"Notice - Before updating ensure that the update is compatible with your Joomla! installation."


This is because I have recently added the support for joomla upgrade, but it doesn't work yet for "payed" extensions... and I am lazy. So you will get the notification, but you still need to download and install it manually.

Kind regards,
Luigi
Last edit: 7 years 6 months ago by admin.
The following user(s) said Thank You: phuture

Please Log in or Create an account to join the conversation.

  • phuture
  • phuture's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 6 months ago - 7 years 6 months ago #6140 by phuture

Hi George,


Hi Luigi, Thanks for the answers.


1) "Platform Type". I assumed (wrongly) that "Generic" meant any platform. I have only 1 registered, iOS, device for testing and if I create a notification to test it, it doesn't get sent if I have generic selected as the platform.
I have to specifically state "iOS" as the platform and then it works fine.
This doesn't work well as jBackend should, I think, be abstracting the notifications and hardware. The software sending user notification shouldn't need to know what platform type the user is using.

No, generic is a kind of "default" value that could be useful in the next future (e.g. web push).


Any chance of adding a 4th option of "Any" or "All"?
In the real world a Joomla Website is likely to have both Android & iOS Apps.
Joomla components shouldn't need to know, or care, what platform any one user is using.
I would expect jbackend, as it holds the data, to do the look up on platforms not the other components.


2) I don't understand why the programmatical creation of notifications needs to be via the REST API?
Why is there no direct JPluginHelper / JDispatcher ->trigger support?
I've written my own into my custom jbackend plugin for notifying a single user which works ok with the exception of (1) above. I would have expected this to be part of the standard package though?

No, there is and I already use it for my customers, but probably I should document it in the developer section. If you look at the helper.php on the site part (not admin) you will find a well documented function to create and add notifications to queue programmatically. This is the most flexible way to provide this feature to any developer for me. I have already used it to create push, as example, when a type of content is added, when a balance entry is created, when a form is compiled, and so on...


You mean "jBackendHelper::createNotification()" ?
Yes, I found that and that's what I used to create my own notification plugin for my component.
I was concerned though that it wasn't referenced in the documentation (I might have missed it, I missed the App docs on .PEM files :) )
If that function is meant to be called and it will always remain available in future updates then that's fine, I have the solution I want.


I have another feature request.
At the moment notifications are single use.
Would be possible to create static, use many times, notifications which have a label, or ID, much like the appcode?
That way I can set up the notification with static content for common notifications and then just add users (or groups, or devices) to it (using it's id as ref) rather than creating multiple notifications.
Each time the scheduler gets called it flushes out and empties the recipients when it sends to them.
This would be a much more scalable solution I think.

Thanks again,
George
Last edit: 7 years 6 months ago by phuture.

Please Log in or Create an account to join the conversation.

More
7 years 6 months ago #6141 by admin
Hi George.

Any chance of adding a 4th option of "Any" or "All"?
In the real world a Joomla Website is likely to have both Android & iOS Apps.
Joomla components shouldn't need to know, or care, what platform any one user is using.
I would expect jbackend, as it holds the data, to do the look up on platforms not the other components.


Probably, not sure yet. I am just now working on the same thing but for node.js and with Firebase (a personal project, btw), and I am falling in love with it. So probably I will switch the push plugin on this platform too. And in this case your request will be automatically satisfied.

If that function is meant to be called and it will always remain available in future updates then that's fine, I have the solution I want.


Of course yes. This is the reason I created it... :)

Would be possible to create static, use many times, notifications which have a label, or ID, much like the appcode?
That way I can set up the notification with static content for common notifications and then just add users (or groups, or devices) to it (using it's id as ref) rather than creating multiple notifications.
Each time the scheduler gets called it flushes out and empties the recipients when it sends to them.
This would be a much more scalable solution I think.


I think yes. It could be possible to add "placeholders" for each app, or maybe common shared placeholders, that could be used in push item. I will think about it in the next version (the one with FCM support).

Kind regards,
Luigi
The following user(s) said Thank You: phuture

Please Log in or Create an account to join the conversation.

Time to create page: 0.135 seconds