Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Files modified:
EventApp-data.sql ~Added device token table
Notifications.php ~Added “send IOS notification” button that would invoke an Ajax call to post.php (See new files)
New Files:
Store-token.php ~This handles the POST from the IOS app whenever a QR code is scanned. The APP passes in the event id and device token which is then stored in the new device token table.
Apn-2022.key/crt ~These are the certificate files that allow the server communicate with APNs
Post.php ~This is the file that will query the stored tokens and send out the notification for the devices that match the event id.
Future Work:
Removing old device entries ~There is currently no way to detect when a user no longer has an app or switched events. In either case, the device_tokens entry should be removed so that there aren’t useless rows in the table.
Invoke background check ~When we send out the notification, we may want to tell the phone to grab new event information. Currently, the app still may have to be manually refreshed to reflect new information. A good fix for this would be to make the app grab new information ever time the user opens the app.
Clean up needed notification code ~Someone should go through and remove the notification code that is no longer needed. Some of it is required by android still, but there are a few IOS specific methods/files that are no longer needed.