-
Notifications
You must be signed in to change notification settings - Fork 62
chore: [SDK-4406] prepare Unity demo app for Appium E2E tests #869
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
59 commits
Select commit
Hold shift + click to select a range
44c3756
chore(demo): prepare demo app for Appium E2E tests
fadi-george 99a80dd
chore(demo): remove LogManager, use Debug.Log
fadi-george 207de0d
chore(demo): standardize UI element names for Appium tests
fadi-george b225f34
chore(demo): replace loading overlay with inline loading states
fadi-george 5d10a9a
chore(demo): improve UI element names for Appium tests
fadi-george 5f59a7d
feat(demo): add accessibility bridge for Appium E2E
fadi-george ce4aaef
fix(demo): improve a11y bridge reliability
fadi-george 976475e
fix(demo): force iOS keyboard dismiss on modal close
fadi-george 44978e3
fix(demo): fix loading state in login/logout flow
fadi-george 185d13d
fix(demo): fix info-icon taps in Appium E2E tests
fadi-george bd65c0b
fix(demo): add a11y support for SwitchToggle
fadi-george ba1e616
feat(demo): add iOS signing post-processor
fadi-george dd0d6de
fix(demo): source IAM paused state from prefs
fadi-george fad8cf5
fix(demo): clarify add button labels
fadi-george 66d364e
fix(demo): align dialog to top with padding
fadi-george 45acb10
fix(demo): add a11y label to toast for Appium
fadi-george cbd0970
wip
fadi-george cd675ec
fix(demo): remove bottom safe area padding
fadi-george e166afb
fix(demo): stabilize XCUITest taps on ScrollView
fadi-george 90cb3b2
fix(demo): add named-tap fallback for E2E reliability
fadi-george 89178bb
fix(demo): refactor E2E tap fallback to use target registry
fadi-george f6feee1
fix(demo): prevent double-submit and duplicate aliases
fadi-george 144d88b
refactor(demo): consolidate upsert helpers into MergePairs
fadi-george 5db7c85
feat(demo): add app bar shadow element
fadi-george 73517f2
chore(demo): bump Unity editor and packages
fadi-george 15eac3f
fix(demo): trigger E2E tap on pointer up
fadi-george 0119424
feat(demo): sync accessibility on toast show/hide
fadi-george 24c5076
fix(demo): use prefs for location shared state
fadi-george 386b6de
fix(demo): use cached location shared state
fadi-george e5f7ac8
fix(demo): cancel E2E tap on click event
fadi-george 459c708
feat(demo): add Android native accessibility bridge
fadi-george a9aa1ad
fix(demo): hide default checkbox indicator
fadi-george 3654d95
fix(demo): suppress spell-check underline on E2E input
fadi-george f3832a0
feat(demo): add E2E gutter swipe scroll support
fadi-george a712965
fix(demo): skip a11y sync when nothing changed
fadi-george 152d6da
fix(demo): use BaseBoolField for radio a11y support
fadi-george d119746
fix(demo): incremental a11y rebuild to preserve node identity
fadi-george acbfa62
fix(demo): pin widget pod to OneSignal version
fadi-george 5f0312e
fix(demo): register SDK listeners before config
fadi-george 9270923
refactor(demo): remove E2E tap fallback machinery
fadi-george 71f3fc4
refactor(demo): rename E2E tap registry to AndroidClickTarget
fadi-george d163e13
fix(demo): set simulator arch to arm64 for Apple Silicon
fadi-george e16974f
refactor(demo): replace root PointerDown with ClickEvent
fadi-george d6cbdc5
fix(demo): restore panel-root PointerDown for iOS info icons
fadi-george ec0d7df
refactor(demo): disable tap-marker overlay
fadi-george ef04560
refactor(demo): remove ShowToast calls
fadi-george 74a1c22
refactor(demo): trim inputs and extract RenderPairList
fadi-george 3f8bb50
fix(demo): suppress dev console in E2E mode
fadi-george f7a94f6
fix(demo): force accessibility refresh on foreground
fadi-george c204543
fix: [SDK-4406] use monotonic row index in MultiPairInputDialog
fadi-george f8ba425
fix(demo): fix stale Android click targets and IAM WebView debugging
fadi-george c35fb86
fix(demo): address Unity demo PR feedback
fadi-george a213803
fix(demo): register back button as E2E tap target
fadi-george 384badd
fix(demo): apply safe area to secondary screen
fadi-george 96b8e5b
fix(demo): route push permission through OneSignal SDK
fadi-george b3c0c3c
fix(demo): make Android channel ID configurable
fadi-george b3e5f34
fix(demo): prompt push before loading data
fadi-george 0ab8306
fix(demo): bundle vine_boom sound and restore EndLiveActivity guard
fadi-george bd69e62
chore: remove legacy notification.wav from Android SDK sample resources
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
2 changes: 1 addition & 1 deletion
2
com.onesignal.unity.android/Editor/OneSignalConfig.androidlib/consumer-proguard.pro
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| -keep class com.onesignal.** { *; } | ||
|
|
||
| # Work around for IllegalStateException with kotlinx-coroutines-android | ||
| -keep class kotlinx.coroutines.android.AndroidDispatcherFactory {*;} | ||
| -keep class kotlinx.coroutines.android.AndroidDispatcherFactory {*;} |
Binary file removed
BIN
-11.9 KB
...esignal.unity.android/Editor/OneSignalConfig.androidlib/src/main/res/raw/notification.wav
Binary file not shown.
7 changes: 0 additions & 7 deletions
7
...al.unity.android/Editor/OneSignalConfig.androidlib/src/main/res/raw/notification.wav.meta
This file was deleted.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,8 @@ | ||
| # Default App ID (used when ONESIGNAL_APP_ID is empty or missing): 77e32082-ea27-42e3-a898-c72e141824ef | ||
| ONESIGNAL_APP_ID=your-onesignal-app-id | ||
| ONESIGNAL_API_KEY=your_rest_api_key | ||
| E2E_MODE=false | ||
|
|
||
| # Optional: Android Notification Channel ID for the WITH SOUND test notification. | ||
| # Create one in your OneSignal dashboard under Settings > Android Notification Categories. | ||
| ONESIGNAL_ANDROID_CHANNEL_ID= |
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
154 changes: 154 additions & 0 deletions
154
examples/demo/Assets/App/Editor/iOS/SigningPostProcessor.cs
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,154 @@ | ||
| #if UNITY_IOS | ||
|
|
||
| using System.IO; | ||
| using UnityEditor; | ||
| using UnityEditor.Build; | ||
| using UnityEditor.Build.Reporting; | ||
| using UnityEditor.iOS.Xcode; | ||
| using UnityEngine; | ||
|
|
||
| namespace App.Editor.iOS | ||
| { | ||
| /// <summary> | ||
| /// Final iOS post-processor for the demo app. Runs AFTER the OneSignal | ||
| /// SDK and demo widget post-processors so it can correct things they set: | ||
| /// | ||
| /// 1. Flips the main target's aps-environment from "production" (the SDK | ||
| /// default) to "development". The demo only ever runs on simulator or | ||
| /// a development device; "production" mismatches the simulator's APNS | ||
| /// environment and triggers iOS's "Keep receiving notifications?" | ||
| /// tuning prompt on first delivery (matches what the Flutter demo | ||
| /// ships with). | ||
| /// | ||
| /// 2. Normalizes extension bundle IDs to short suffixes (`.NSE`, `.LA`) | ||
| /// to match the Flutter demo and keep provisioning profile names | ||
| /// consistent across SDKs. | ||
| /// | ||
| /// 3. Pins DEVELOPMENT_TEAM on all targets so a future Manual signing | ||
| /// setup with the OneSignal-owned profiles works without manual | ||
| /// fix-up in Xcode. | ||
| /// </summary> | ||
| public class SigningPostProcessor : IPostprocessBuildWithReport | ||
| { | ||
| private const string AppleTeamId = "99SW8E36CT"; | ||
| private const string ApsEnvironment = "development"; | ||
|
|
||
| private const string NseTargetName = "OneSignalNotificationServiceExtension"; | ||
| private const string WidgetTargetName = "OneSignalWidgetExtension"; | ||
|
|
||
| // Short bundle-id suffixes (match the Flutter demo). | ||
| private const string NseBundleSuffix = "NSE"; | ||
| private const string WidgetBundleSuffix = "LA"; | ||
|
|
||
| // Run after both demo widget post-processor (45) and SDK | ||
| // post-processor (45). 100 puts us after pod install (50) too. | ||
| public int callbackOrder => 100; | ||
|
|
||
| public void OnPostprocessBuild(BuildReport report) | ||
| { | ||
| if (report.summary.platform != BuildTarget.iOS) | ||
| return; | ||
|
|
||
| var outputPath = report.summary.outputPath; | ||
| FixupApsEnvironment(outputPath); | ||
| FixupSigningAndBundleIds(outputPath); | ||
| } | ||
|
|
||
| private static void FixupApsEnvironment(string outputPath) | ||
| { | ||
| var project = new PBXProject(); | ||
| var projectPath = PBXProject.GetPBXProjectPath(outputPath); | ||
| project.ReadFromString(File.ReadAllText(projectPath)); | ||
|
|
||
| var mainTargetGuid = project.GetUnityMainTargetGuid(); | ||
| var relPath = project.GetBuildPropertyForAnyConfig( | ||
| mainTargetGuid, | ||
| "CODE_SIGN_ENTITLEMENTS" | ||
| ); | ||
|
|
||
| if (string.IsNullOrEmpty(relPath)) | ||
| { | ||
| Debug.LogWarning( | ||
| "[SigningPostProcessor] Main target has no CODE_SIGN_ENTITLEMENTS; " | ||
| + "skipping aps-environment fixup." | ||
| ); | ||
| return; | ||
| } | ||
|
|
||
| var fullPath = Path.Combine(outputPath, relPath); | ||
| if (!File.Exists(fullPath)) | ||
| { | ||
| Debug.LogWarning( | ||
| $"[SigningPostProcessor] Entitlements file not found at {fullPath}; skipping." | ||
| ); | ||
| return; | ||
| } | ||
|
|
||
| var plist = new PlistDocument(); | ||
| plist.ReadFromFile(fullPath); | ||
| plist.root.SetString("aps-environment", ApsEnvironment); | ||
| plist.WriteToFile(fullPath); | ||
|
|
||
| Debug.Log( | ||
| $"[SigningPostProcessor] Set aps-environment=\"{ApsEnvironment}\" in {relPath}" | ||
| ); | ||
| } | ||
|
|
||
| private static void FixupSigningAndBundleIds(string outputPath) | ||
| { | ||
| var project = new PBXProject(); | ||
| var projectPath = PBXProject.GetPBXProjectPath(outputPath); | ||
| project.ReadFromString(File.ReadAllText(projectPath)); | ||
|
|
||
| var appId = PlayerSettings.GetApplicationIdentifier(BuildTargetGroup.iOS); | ||
|
|
||
| ApplyTeamId(project, project.GetUnityMainTargetGuid(), "Unity-iPhone"); | ||
|
|
||
| ApplyExtensionFixup( | ||
| project, | ||
| NseTargetName, | ||
| $"{appId}.{NseBundleSuffix}" | ||
| ); | ||
| ApplyExtensionFixup( | ||
| project, | ||
| WidgetTargetName, | ||
| $"{appId}.{WidgetBundleSuffix}" | ||
| ); | ||
|
|
||
| File.WriteAllText(projectPath, project.WriteToString()); | ||
| } | ||
|
|
||
| private static void ApplyTeamId(PBXProject project, string targetGuid, string label) | ||
| { | ||
| if (string.IsNullOrEmpty(targetGuid)) | ||
| return; | ||
|
|
||
| project.SetBuildProperty(targetGuid, "DEVELOPMENT_TEAM", AppleTeamId); | ||
| Debug.Log($"[SigningPostProcessor] Pinned DEVELOPMENT_TEAM={AppleTeamId} on {label}"); | ||
| } | ||
|
|
||
| private static void ApplyExtensionFixup( | ||
| PBXProject project, | ||
| string targetName, | ||
| string bundleId | ||
| ) | ||
| { | ||
| var guid = project.TargetGuidByName(targetName); | ||
| if (string.IsNullOrEmpty(guid)) | ||
| { | ||
| Debug.LogWarning( | ||
| $"[SigningPostProcessor] Target '{targetName}' not found; skipping." | ||
| ); | ||
| return; | ||
| } | ||
|
|
||
| project.SetBuildProperty(guid, "PRODUCT_BUNDLE_IDENTIFIER", bundleId); | ||
| ApplyTeamId(project, guid, targetName); | ||
| Debug.Log( | ||
| $"[SigningPostProcessor] Set {targetName} PRODUCT_BUNDLE_IDENTIFIER={bundleId}" | ||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
2 changes: 2 additions & 0 deletions
2
examples/demo/Assets/App/Editor/iOS/SigningPostProcessor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 6 additions & 1 deletion
7
examples/demo/Assets/Plugins/Android/OneSignalConfig.androidlib/consumer-proguard.pro
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 |
|---|---|---|
| @@ -1,4 +1,9 @@ | ||
| -keep class com.onesignal.** { *; } | ||
|
|
||
| # Work around for IllegalStateException with kotlinx-coroutines-android | ||
| -keep class kotlinx.coroutines.android.AndroidDispatcherFactory {*;} | ||
| -keep class kotlinx.coroutines.android.AndroidDispatcherFactory {*;} | ||
|
|
||
| # WorkManager initializes a Room database through AndroidX Startup before Unity starts. | ||
| # Unity release builds run R8, so keep the generated database implementation reachable. | ||
| -keep class androidx.work.impl.WorkDatabase* { *; } | ||
| -keep class androidx.work.impl.model.** { *; } |
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.