-
Notifications
You must be signed in to change notification settings - Fork 62
chore: [SDK-4218] add Live Activities support to Unity demo #863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
76040e4
feat(demo): add Live Activities support
fadi-george 4e50ac3
refactor(demo): rename ExampleWidget to OneSignalWidget
fadi-george 8635bf0
refactor(demo): rename Activity to Screen in UI text
fadi-george bee8914
feat(demo): add env file build support for builds
fadi-george f9c206b
style(demo): add top margin to next button
fadi-george 80a9b0f
feat(liveactivities): deprecate ExitAsync method
fadi-george 2be7ab9
fix(demo): handle quoted env values and empty fields
fadi-george f28a3c9
fix(demo): disable end button during live activity updates
fadi-george 2ba66dc
fix(demo): address PR review feedback
fadi-george 36f771d
fix(demo): address second round of PR review feedback
fadi-george File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
| ONESIGNAL_API_KEY=your_rest_api_key |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,41 @@ | ||
| using System.IO; | ||
| using UnityEditor; | ||
| using UnityEditor.Build; | ||
| using UnityEditor.Build.Reporting; | ||
| using UnityEngine; | ||
|
|
||
| namespace OneSignalDemo.Editor | ||
| { | ||
| public class CopyEnvPreBuild : IPreprocessBuildWithReport | ||
| { | ||
| public int callbackOrder => 0; | ||
|
|
||
| public void OnPreprocessBuild(BuildReport report) | ||
| { | ||
| var projectRoot = Path.GetDirectoryName(Application.dataPath); | ||
| var source = Path.Combine(projectRoot, ".env"); | ||
| var dest = Path.Combine(Application.streamingAssetsPath, ".env"); | ||
|
|
||
| if (!File.Exists(source)) | ||
| { | ||
| Debug.LogWarning( | ||
| "[OneSignalDemo] No .env file found at project root. " | ||
| + "Live Activity API calls will be disabled. " | ||
| + "Copy .env.example to .env and add your key." | ||
| ); | ||
| if (File.Exists(dest)) | ||
| { | ||
| File.Delete(dest); | ||
|
claude[bot] marked this conversation as resolved.
|
||
| var metaPath = dest + ".meta"; | ||
| if (File.Exists(metaPath)) | ||
|
fadi-george marked this conversation as resolved.
|
||
| File.Delete(metaPath); | ||
| } | ||
| return; | ||
| } | ||
|
|
||
| Directory.CreateDirectory(Application.streamingAssetsPath); | ||
| File.Copy(source, dest, overwrite: true); | ||
| Debug.Log("[OneSignalDemo] Copied .env to StreamingAssets"); | ||
| } | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.