-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #1570 and home-assistant/core#50750. Fixes #1382. ## Summary Adds a new app extension to do local push notifications on iOS 14 when connected to internal SSIDs. ## Screenshots Adds a default-on setting to Internal URL: | Light | Dark | | -- | -- | | ![Simulator Screen Shot - iPhone 12 Pro - 2021-06-19 at 23 13 04](https://user-images.githubusercontent.com/74188/122664142-5cd73d80-d154-11eb-8378-600f0b82b3e4.png) | ![Simulator Screen Shot - iPhone 12 Pro - 2021-06-19 at 23 13 06](https://user-images.githubusercontent.com/74188/122664145-62cd1e80-d154-11eb-840d-0a0e86255bcb.png) | ## Link to pull request in Documentation repository Documentation: home-assistant/companion.home-assistant#539 ## Any other notes - Updates the "you need always permission" warning in Internal URL editing to be vibrantly red, to really point out its importance. - Sets the code signing for the app and the push target to 'manual' on device, hopefully for our internal team only. Special entitlements really do not play well with open source. Worth noting that it is not possible to test this feature without being on the HA team since it does not work in simulator (as far as I can tell) and running on-device requires entitlements. - Moves commands into Shared in a slightly-easier registration mechanism, so we can share them in the local push extension.
- Loading branch information
Showing
51 changed files
with
1,055 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Configuration/Entitlements/activate_special_entitlements.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
if [[ $CI && $CONFIGURATION != "Release" ]]; then | ||
echo "warning: Critical alerts disabled for CI" | ||
elif [[ ${ENABLE_CRITICAL_ALERTS} -eq 1 ]]; then | ||
entitlements_file="${TARGET_TEMP_DIR}/${FULL_PRODUCT_NAME}.xcent" | ||
/usr/libexec/PlistBuddy -c "add com.apple.developer.usernotifications.critical-alerts bool true" "$entitlements_file" | ||
else | ||
echo "warning: Critical alerts disabled" | ||
fi | ||
|
||
if [[ $CI && $CONFIGURATION != "Release" ]]; then | ||
echo "warning: Push provider disabled for CI" | ||
elif [[ ${ENABLE_PUSH_PROVIDER} -eq 1 ]]; then | ||
entitlements_file="${TARGET_TEMP_DIR}/${FULL_PRODUCT_NAME}.xcent" | ||
/usr/libexec/PlistBuddy -c "add com.apple.developer.networking.networkextension array" "$entitlements_file" | ||
/usr/libexec/PlistBuddy -c "add com.apple.developer.networking.networkextension:0 string 'app-push-provider'" "$entitlements_file" | ||
else | ||
echo "warning: Push provider disabled" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+12.4 KB
...ea44bb7f-931e-4007-b33f-154d7af53668_io.robbie.HomeAssistant.PushProvider.mobileprovision
Binary file not shown.
Binary file renamed
BIN
+14.4 KB
....robbie.HomeAssistant.dev.mobileprovision → ....robbie.HomeAssistant.dev.mobileprovision
Binary file not shown.
Binary file renamed
BIN
+14 KB
...ssistant.dev.PushProvider.mobileprovision → ...ssistant.dev.PushProvider.mobileprovision
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/App-Beta.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/App-Debug.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/App-Release.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Codegen.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Extensions-Intents.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Extensions-NotificationContent.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Extensions-NotificationService.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Extensions-Share.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Extensions-Today.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Extensions-Widgets.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Launcher.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Shared-iOS.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Tests-UI.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/Tests-Unit.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/WatchApp (Complication).xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/WatchApp (Notification).xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
HomeAssistant.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Sources/App/Notifications/NotificationManagerLocalPushInterface.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import HAKit | ||
import Shared | ||
|
||
enum NotificationManagerLocalPushStatus { | ||
case allowed(LocalPushManager.State) | ||
case disabled | ||
case unsupported | ||
} | ||
|
||
protocol NotificationManagerLocalPushInterface { | ||
var status: NotificationManagerLocalPushStatus { get } | ||
func addObserver(_ handler: @escaping (NotificationManagerLocalPushStatus) -> Void) -> HACancellable | ||
} |
Oops, something went wrong.