-
Notifications
You must be signed in to change notification settings - Fork 84
SDK-216 BCIT App configured for deep link handling #991
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
15 commits
Select commit
Hold shift + click to select a range
b129e4f
Started work on deep link ticket all commits condensed for the day
sumeruchat 64b670e
Fix
sumeruchat 68aa109
Fixes
sumeruchat 4d9658f
add entitlements file
sumchattering d067a87
Add functionality to app delegate for testing
sumchattering 441b65c
Initial commit
sumchattering 8c5049a
Initial commit
sumchattering 8b25b86
Remove dead code
sumchattering 8c9725e
Merge branch 'master' into feature/BCIT-deeplink
joaodordio 7983847
Initial commit
sumchattering 856da60
Fixes
sumchattering 0ada358
Fixes
sumchattering 2a9cdb1
Fixes
sumchattering eeec00b
Fixes
sumchattering 1ee1f82
Fixes
sumchattering 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
106 changes: 106 additions & 0 deletions
106
.github/workflows/bcit-integration-test-deep-linking.yml
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,106 @@ | ||
| name: BCIT Deep Linking Integration Test | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, labeled] | ||
| workflow_dispatch: | ||
| inputs: | ||
| ref: | ||
| description: 'Branch or commit to test (leave empty for current branch)' | ||
| required: false | ||
| type: string | ||
|
|
||
| jobs: | ||
| deep-linking-test: | ||
| name: BCIT Deep Linking Integration Test | ||
| runs-on: macos-latest | ||
| timeout-minutes: 30 | ||
| env: | ||
| XCODE_VERSION: '16.4' | ||
| if: > | ||
| github.event_name == 'workflow_dispatch' || | ||
| ( | ||
| github.event_name == 'pull_request' && ( | ||
| contains(github.event.pull_request.labels.*.name, 'bcit') || | ||
| contains(github.event.pull_request.labels.*.name, 'BCIT') || | ||
| contains(github.event.pull_request.labels.*.name, 'bcit-deeplink') || | ||
| contains(github.event.pull_request.labels.*.name, 'BCIT-DEEPLINK') || | ||
| contains(github.event.pull_request.labels.*.name, 'bcit-deep-linking') || | ||
| contains(github.event.pull_request.labels.*.name, 'BCIT-DEEP-LINKING') || | ||
| contains(github.event.pull_request.labels.*.name, 'Bcit') || | ||
| contains(github.event.pull_request.labels.*.name, 'Bcit-Deeplink') || | ||
| startsWith(github.event.pull_request.head.ref, 'release/') | ||
| ) | ||
| ) | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.inputs.ref || github.ref }} | ||
|
|
||
| - name: Setup Xcode | ||
| uses: maxim-lobanov/setup-xcode@v1 | ||
| with: | ||
| xcode-version: ${{ env.XCODE_VERSION }} | ||
|
|
||
| - name: Validate Xcode Version | ||
| run: | | ||
| echo "π Validating Xcode version and environment..." | ||
| echo "DEVELOPER_DIR: $DEVELOPER_DIR" | ||
| # Check xcodebuild version | ||
| echo "π Checking xcodebuild version..." | ||
| ACTUAL_XCODE_VERSION=$(xcodebuild -version | head -n 1 | awk '{print $2}') | ||
| echo "Xcode version: $ACTUAL_XCODE_VERSION" | ||
| echo "Expected version: $XCODE_VERSION" | ||
| # Check xcodebuild path | ||
| XCODEBUILD_PATH=$(which xcodebuild) | ||
| echo "xcodebuild path: $XCODEBUILD_PATH" | ||
| # Verify we're using the correct Xcode version | ||
| if echo "$ACTUAL_XCODE_VERSION" | grep -q "$XCODE_VERSION"; then | ||
| echo "β Using correct Xcode version: $ACTUAL_XCODE_VERSION" | ||
| else | ||
| echo "β Incorrect Xcode version!" | ||
| echo "Current: $ACTUAL_XCODE_VERSION" | ||
| echo "Expected: $XCODE_VERSION" | ||
| exit 1 | ||
| fi | ||
| - name: Setup Local Environment | ||
| working-directory: tests/business-critical-integration | ||
| run: | | ||
| echo "π Setting up local environment for integration tests..." | ||
| # Run setup script with parameters from repository secrets | ||
| ./scripts/setup-local-environment.sh \ | ||
| "${{ secrets.BCIT_TEST_PROJECT_ID }}" \ | ||
| "${{ secrets.BCIT_ITERABLE_SERVER_KEY }}" \ | ||
| "${{ secrets.BCIT_ITERABLE_API_KEY }}" | ||
| - name: Validate Setup | ||
| working-directory: tests/business-critical-integration | ||
| run: | | ||
| echo "π Validating environment setup..." | ||
| ./scripts/validate-setup.sh | ||
| - name: Run Deep Linking Tests | ||
| working-directory: tests/business-critical-integration | ||
| run: | | ||
| echo "π§ͺ Running deep linking integration tests..." | ||
| CI=true ./scripts/run-tests.sh deeplink | ||
| - name: Upload Test Results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: deep-linking-test-results | ||
| path: | | ||
| tests/business-critical-integration/reports/ | ||
| tests/business-critical-integration/screenshots/ | ||
| tests/business-critical-integration/logs/ | ||
| retention-days: 7 | ||
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 |
|---|---|---|
|
|
@@ -86,10 +86,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | |
| IterableAppIntegration.application(application, didReceiveRemoteNotification: userInfo, fetchCompletionHandler: completionHandler) | ||
| } | ||
|
|
||
| // MARK: - Deep link | ||
| // MARK: - Deep link (Universal Links) | ||
|
|
||
| func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { | ||
| return true // No deep link handling in this test app | ||
| print("π [APP] Universal link received via NSUserActivity") | ||
| print("π [APP] Activity type: \(userActivity.activityType)") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is our deep / universal link handler |
||
|
|
||
| // Handle universal links (e.g., from Reminders, Notes, Safari, etc.) | ||
| if userActivity.activityType == NSUserActivityTypeBrowsingWeb, | ||
| let url = userActivity.webpageURL { | ||
| print("π [APP] Universal link URL: \(url.absoluteString)") | ||
|
|
||
| // Pass to Iterable SDK for unwrapping and handling | ||
| // The SDK will unwrap /a/ links and call the URL delegate with the destination URL | ||
| IterableAPI.handle(universalLink: url) | ||
| return true | ||
| } | ||
|
|
||
| return false | ||
| } | ||
|
|
||
| func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { | ||
|
|
@@ -336,12 +350,13 @@ extension AppDelegate: IterableURLDelegate { | |
| func handle(iterableURL url: URL, inContext context: IterableActionContext) -> Bool { | ||
| print("π BREAKPOINT HERE: IterableURLDelegate.handle called!") | ||
| print("π URL: \(url.absoluteString)") | ||
| print("π Context: \(context)") | ||
| print("π Context source: \(context.source)") | ||
|
|
||
| // Set a breakpoint on the next line to see if this method gets called | ||
| let urlScheme = url.scheme ?? "no-scheme" | ||
| print("π URL scheme: \(urlScheme)") | ||
|
|
||
| // Handle tester:// deep links (unwrapped destination URLs) | ||
| if url.scheme == "tester" { | ||
| print("β App is opened via Iterable deep link - tester://") | ||
|
|
||
|
|
@@ -369,6 +384,23 @@ extension AppDelegate: IterableURLDelegate { | |
| return true // We handled this URL | ||
| } | ||
|
|
||
| // Handle https:// links (could be unwrapped universal links) | ||
| if url.scheme == "https" { | ||
| print("π HTTPS URL received in URL delegate: \(url.absoluteString)") | ||
|
|
||
| // Check if this is from our tracking domain (shouldn't happen if SDK unwrapped correctly) | ||
| if url.host == "links.tsetester.com" { | ||
| print("β οΈ Received wrapped tracking URL - SDK may not have unwrapped it") | ||
| } | ||
|
|
||
| // Show alert for HTTPS deep links | ||
| DispatchQueue.main.async { | ||
| self.showDeepLinkAlert(url: url) | ||
| } | ||
|
|
||
| return true | ||
| } | ||
|
|
||
| print("π URL scheme '\(url.scheme ?? "nil")' not handled by our app") | ||
| return false // We didn't handle this URL | ||
| } | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -6,8 +6,7 @@ | |
| <string>development</string> | ||
| <key>com.apple.developer.associated-domains</key> | ||
| <array> | ||
| <string>applinks:example.com</string> | ||
| <string>applinks:links.example.com</string> | ||
| <string>applinks:links.tsetester.com</string> | ||
| </array> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is where we have specified an associated domain |
||
| </dict> | ||
| </plist> | ||
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.