-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #881 from OneSignal/push-to-start-live-activities
Push to Start Live Activities
- Loading branch information
Showing
20 changed files
with
692 additions
and
44 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
example/ios/ExampleWidget/Assets.xcassets/AccentColor.colorset/Contents.json
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,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
example/ios/ExampleWidget/Assets.xcassets/AppIcon.appiconset/Contents.json
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 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
example/ios/ExampleWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json
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,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
example/ios/ExampleWidget/Assets.xcassets/onesignaldemo.imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "onesignal-logo.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+20.1 KB
...ple/ios/ExampleWidget/Assets.xcassets/onesignaldemo.imageset/onesignal-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,17 @@ | ||
// | ||
// ExampleWidgetBundle.swift | ||
// ExampleWidget | ||
// | ||
// Created by Brian Smith on 4/30/24. | ||
// Copyright © 2024 The Chromium Authors. All rights reserved. | ||
// | ||
|
||
import WidgetKit | ||
import SwiftUI | ||
|
||
@main | ||
struct ExampleWidgetBundle: WidgetBundle { | ||
var body: some Widget { | ||
ExampleWidgetLiveActivity() | ||
} | ||
} |
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,66 @@ | ||
// | ||
// ExampleWidgetLiveActivity.swift | ||
// ExampleWidget | ||
// | ||
// Created by Brian Smith on 4/30/24. | ||
// Copyright © 2024 The Chromium Authors. All rights reserved. | ||
// | ||
|
||
import ActivityKit | ||
import WidgetKit | ||
import SwiftUI | ||
import OneSignalLiveActivities | ||
|
||
struct ExampleWidgetLiveActivity: Widget { | ||
var body: some WidgetConfiguration { | ||
ActivityConfiguration(for: DefaultLiveActivityAttributes.self) { context in | ||
// Lock screen/banner UI goes here\VStack(alignment: .leading) { | ||
VStack { | ||
Spacer() | ||
Text("FLUTTER: " + (context.attributes.data["title"]?.asString() ?? "")).font(.headline) | ||
Spacer() | ||
HStack { | ||
Spacer() | ||
Label { | ||
Text(context.state.data["message"]?.asDict()?["en"]?.asString() ?? "") | ||
} icon: { | ||
Image("onesignaldemo") | ||
.resizable() | ||
.scaledToFit() | ||
.frame(width: 40.0, height: 40.0) | ||
} | ||
Spacer() | ||
} | ||
Text("INT: " + String(context.state.data["intValue"]?.asInt() ?? 0)) | ||
Text("DBL: " + String(context.state.data["doubleValue"]?.asDouble() ?? 0.0)) | ||
Text("BOL: " + String(context.state.data["boolValue"]?.asBool() ?? false)) | ||
Spacer() | ||
} | ||
.activitySystemActionForegroundColor(.black) | ||
.activityBackgroundTint(.white) | ||
} dynamicIsland: { _ in | ||
DynamicIsland { | ||
// Expanded UI goes here. Compose the expanded UI through | ||
// various regions, like leading/trailing/center/bottom | ||
DynamicIslandExpandedRegion(.leading) { | ||
Text("Leading") | ||
} | ||
DynamicIslandExpandedRegion(.trailing) { | ||
Text("Trailing") | ||
} | ||
DynamicIslandExpandedRegion(.bottom) { | ||
Text("Bottom") | ||
// more content | ||
} | ||
} compactLeading: { | ||
Text("L") | ||
} compactTrailing: { | ||
Text("T") | ||
} minimal: { | ||
Text("Min") | ||
} | ||
.widgetURL(URL(string: "http://www.apple.com")) | ||
.keylineTint(Color.red) | ||
} | ||
} | ||
} |
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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionPointIdentifier</key> | ||
<string>com.apple.widgetkit-extension</string> | ||
</dict> | ||
</dict> | ||
</plist> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# | ||
# NOTE: This podspec is NOT to be published. It is only used as a local source! | ||
# This is a generated file; do not edit or check into version control. | ||
# This podspec is NOT to be published. It is only used as a local source! | ||
# This is a generated file; do not edit or check into version control. | ||
# | ||
|
||
Pod::Spec.new do |s| | ||
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s| | |
s.license = { :type => 'BSD' } | ||
s.author = { 'Flutter Dev Team' => '[email protected]' } | ||
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } | ||
s.ios.deployment_target = '11.0' | ||
s.ios.deployment_target = '12.0' | ||
# Framework linking is handled by Flutter tooling, not CocoaPods. | ||
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs. | ||
s.vendored_frameworks = 'path/to/nothing' | ||
|
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
Oops, something went wrong.