Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
# arm64-v8a, so dropping other ABIs trims size with no test impact.
# FIREBASE_INSTALLATION_ID_ENABLED turns on Firebase Installation ID registration,
# which needs the google-services.json written above.
run: ./gradlew assembleDebug -PciSingleAbi -PFIREBASE_INSTALLATION_ID_ENABLED=${{ matrix.fid == 'on' }} --quiet --console=plain --warning-mode=summary
run: ./gradlew assembleDebug -PciSingleAbi -PDEMO_BUNDLE_ID=com.onesignal.sdkdemo -PFIREBASE_INSTALLATION_ID_ENABLED=${{ matrix.fid == 'on' }} --quiet --console=plain --warning-mode=summary

- name: Upload APK
uses: actions/upload-artifact@v7
Expand Down Expand Up @@ -128,6 +128,8 @@ jobs:
-quiet \
-hideShellScriptEnvironment \
CODE_SIGN_STYLE=Manual \
DEMO_BUNDLE_ID=com.onesignal.sdkdemo \
DEMO_TEAM_ID=DL8TF3X4K3 \
COMPILER_INDEX_STORE_ENABLE=NO
xcodebuild -exportArchive \
-archivePath build/App.xcarchive \
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-cap7/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
namespace "com.onesignal.sdkdemo"
compileSdk rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.onesignal.sdkdemo"
applicationId "com.onesignal.example"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<resources>
<string name="app_name">OneSignal Cap7 Demo</string>
<string name="title_activity_main">OneSignal Cap7 Demo</string>
<string name="package_name">com.onesignal.sdkdemo</string>
<string name="custom_url_scheme">com.onesignal.sdkdemo</string>
<string name="package_name">com.onesignal.example</string>
<string name="custom_url_scheme">com.onesignal.example</string>
</resources>
2 changes: 1 addition & 1 deletion examples/demo-cap7/capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
appId: 'com.onesignal.sdkdemo',
appId: 'com.onesignal.example',
appName: 'OneSignal Cap7 Demo',
webDir: 'dist/browser',
loggingBehavior: 'debug',
Expand Down
8 changes: 4 additions & 4 deletions examples/demo-cap7/ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,13 @@
CODE_SIGN_ENTITLEMENTS = App/AppDebug.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DL8TF3X4K3;
DEVELOPMENT_TEAM = 99SW8E36CT;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
Expand All @@ -330,12 +330,12 @@
CODE_SIGN_ENTITLEMENTS = App/AppRelease.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DL8TF3X4K3;
DEVELOPMENT_TEAM = 99SW8E36CT;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_VERSION = 5.0;
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-cap7/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import OneSignal, { LogLevel } from '@onesignal/capacitor-plugin';

import { classifyNotificationResponse } from './notification-response';

const ONESIGNAL_APP_ID = '77e32082-ea27-42e3-a898-c72e141824ef';
const ONESIGNAL_APP_ID = '1154c350-e715-4b71-a58b-1b84b6745baa';

@Component({
selector: 'app-root',
Expand Down
8 changes: 1 addition & 7 deletions examples/demo-no-location/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ vp run android

## Setup

Copy `.env.example` to `.env` and set your OneSignal app ID:
The demo uses the shared OneSignal demo app (`1154c350-e715-4b71-a58b-1b84b6745baa`) by default. To use your own app, copy `.env.example` to `.env` and set `VITE_ONESIGNAL_APP_ID`:

```sh
cp .env.example .env
```

Then edit `.env`:

```sh
VITE_ONESIGNAL_APP_ID=your-onesignal-app-id
```

The `setup` script exports `ONESIGNAL_DISABLE_LOCATION=true` before packing the local plugin and running Capacitor sync, so Android Gradle and iOS Swift Package Manager resolve OneSignal without the location module.

## iOS
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-no-location/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
namespace = "com.onesignal.sdkdemo"
compileSdk = rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.onesignal.sdkdemo"
applicationId "com.onesignal.example"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<resources>
<string name="app_name">OneSignal No Location</string>
<string name="title_activity_main">OneSignal No Location</string>
<string name="package_name">com.onesignal.sdkdemo</string>
<string name="custom_url_scheme">com.onesignal.sdkdemo</string>
<string name="package_name">com.onesignal.example</string>
<string name="custom_url_scheme">com.onesignal.example</string>
</resources>
2 changes: 1 addition & 1 deletion examples/demo-no-location/capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
appId: 'com.onesignal.sdkdemo',
appId: 'com.onesignal.example',
appName: 'OneSignal No Location',
webDir: 'dist',
loggingBehavior: 'debug',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
CODE_SIGN_ENTITLEMENTS = App/AppDebug.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DL8TF3X4K3;
DEVELOPMENT_TEAM = 99SW8E36CT;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -315,7 +315,7 @@
);
MARKETING_VERSION = 1.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
Expand All @@ -330,15 +330,15 @@
CODE_SIGN_ENTITLEMENTS = App/AppRelease.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DL8TF3X4K3;
DEVELOPMENT_TEAM = 99SW8E36CT;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_VERSION = 5.0;
Expand Down
3 changes: 2 additions & 1 deletion examples/demo-no-location/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import OneSignal, { LogLevel } from '@onesignal/capacitor-plugin';
import { useCallback, useEffect, useState } from 'react';

const ONESIGNAL_APP_ID = import.meta.env.VITE_ONESIGNAL_APP_ID?.trim() || 'your-onesignal-app-id';
const ONESIGNAL_APP_ID =
import.meta.env.VITE_ONESIGNAL_APP_ID?.trim() || '1154c350-e715-4b71-a58b-1b84b6745baa';

const isPlaceholder = (value: string): boolean => value.toLowerCase().startsWith('your-');

Expand Down
11 changes: 10 additions & 1 deletion examples/demo-pods/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ plugins {
id("com.android.application")
}

// E2E passes `-PDEMO_BUNDLE_ID=com.onesignal.sdkdemo` to match its google-services.json.
val demoBundleId =
(findProperty("DEMO_BUNDLE_ID") as? String)?.trim()?.takeIf { it.isNotEmpty() } ?: "com.onesignal.example"

android {
namespace = "com.onesignal.sdkdemo"
compileSdk = rootProject.extra["compileSdkVersion"] as Int
buildFeatures {
resValues = true
}
defaultConfig {
applicationId = "com.onesignal.sdkdemo"
applicationId = demoBundleId
resValue("string", "package_name", demoBundleId)
resValue("string", "custom_url_scheme", demoBundleId)
minSdk = rootProject.extra["minSdkVersion"] as Int
targetSdk = rootProject.extra["targetSdkVersion"] as Int
versionCode = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
<resources>
<string name="app_name">OneSignal Demo</string>
<string name="title_activity_main">OneSignal Demo</string>
<string name="package_name">com.onesignal.sdkdemo</string>
<string name="custom_url_scheme">com.onesignal.sdkdemo</string>
</resources>
2 changes: 1 addition & 1 deletion examples/demo-pods/capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
appId: 'com.onesignal.sdkdemo',
appId: 'com.onesignal.example',
appName: 'OneSignal Demo',
webDir: 'dist',
loggingBehavior: 'debug',
Expand Down
2 changes: 2 additions & 0 deletions examples/demo-pods/ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ capacitor-cordova-ios-plugins
# Generated Config files
App/App/capacitor.config.json
App/App/config.xml

local.xcconfig
28 changes: 16 additions & 12 deletions examples/demo-pods/ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
DE30C0F1A2B3C4D5E6F70002 /* demo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = demo.xcconfig; path = ../demo.xcconfig; sourceTree = SOURCE_ROOT; };
2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = "<group>"; };
329C603DA4E0E173315C0022 /* Pods_OneSignalWidgetExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OneSignalWidgetExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4B2607CC29A855A7CD1F906A /* Pods-OneSignalNotificationServiceExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OneSignalNotificationServiceExtension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-OneSignalNotificationServiceExtension/Pods-OneSignalNotificationServiceExtension.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -174,6 +175,7 @@
504EC2FB1FED79650016851F = {
isa = PBXGroup;
children = (
DE30C0F1A2B3C4D5E6F70002 /* demo.xcconfig */,
504EC3061FED79650016851F /* App */,
E8C8D2F32F804D97006581CB /* OneSignalNotificationServiceExtension */,
E8C8D3952F807080006581CB /* OneSignalWidget */,
Expand Down Expand Up @@ -505,6 +507,7 @@
/* Begin XCBuildConfiguration section */
504EC3141FED79650016851F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DE30C0F1A2B3C4D5E6F70002 /* demo.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -562,6 +565,7 @@
};
504EC3151FED79650016851F /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DE30C0F1A2B3C4D5E6F70002 /* demo.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -619,7 +623,7 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DL8TF3X4K3;
DEVELOPMENT_TEAM = "$(DEMO_TEAM_ID)";
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -628,7 +632,7 @@
);
MARKETING_VERSION = 1.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo;
PRODUCT_BUNDLE_IDENTIFIER = "$(DEMO_BUNDLE_ID)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
Expand All @@ -644,15 +648,15 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DL8TF3X4K3;
DEVELOPMENT_TEAM = "$(DEMO_TEAM_ID)";
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo;
PRODUCT_BUNDLE_IDENTIFIER = "$(DEMO_BUNDLE_ID)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_VERSION = 5.0;
Expand All @@ -673,7 +677,7 @@
CODE_SIGN_ENTITLEMENTS = OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DL8TF3X4K3;
DEVELOPMENT_TEAM = "$(DEMO_TEAM_ID)";
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -690,7 +694,7 @@
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo.OneSignalNotificationServiceExtensionCap;
PRODUCT_BUNDLE_IDENTIFIER = "$(DEMO_BUNDLE_ID).OneSignalNotificationServiceExtensionCap";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
Expand All @@ -716,7 +720,7 @@
CODE_SIGN_ENTITLEMENTS = OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DL8TF3X4K3;
DEVELOPMENT_TEAM = "$(DEMO_TEAM_ID)";
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -732,7 +736,7 @@
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo.OneSignalNotificationServiceExtensionCap;
PRODUCT_BUNDLE_IDENTIFIER = "$(DEMO_BUNDLE_ID).OneSignalNotificationServiceExtensionCap";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
Expand All @@ -758,7 +762,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DL8TF3X4K3;
DEVELOPMENT_TEAM = "$(DEMO_TEAM_ID)";
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -775,7 +779,7 @@
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo.OneSignalWidget;
PRODUCT_BUNDLE_IDENTIFIER = "$(DEMO_BUNDLE_ID).OneSignalWidget";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
Expand All @@ -802,7 +806,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = DL8TF3X4K3;
DEVELOPMENT_TEAM = "$(DEMO_TEAM_ID)";
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -818,7 +822,7 @@
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.onesignal.sdkdemo.OneSignalWidget;
PRODUCT_BUNDLE_IDENTIFIER = "$(DEMO_BUNDLE_ID).OneSignalWidget";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-pods/ios/App/App/App.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<string>development</string>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.onesignal.sdkdemo.onesignal</string>
<string>group.$(DEMO_BUNDLE_ID).onesignal</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.onesignal.sdkdemo.onesignal</string>
<string>group.$(DEMO_BUNDLE_ID).onesignal</string>
</array>
</dict>
</plist>
6 changes: 6 additions & 0 deletions examples/demo-pods/ios/demo.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// E2E builds pass DEMO_BUNDLE_ID=com.onesignal.sdkdemo DEMO_TEAM_ID=DL8TF3X4K3
// to xcodebuild; that bundle ID is registered to the enterprise team only.
DEMO_BUNDLE_ID = com.onesignal.example
DEMO_TEAM_ID = 99SW8E36CT

#include? "local.xcconfig"
3 changes: 3 additions & 0 deletions examples/demo-pods/ios/local.xcconfig.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Copy to local.xcconfig (gitignored) to sign with your own team.
DEMO_BUNDLE_ID = com.yourcompany.onesignaldemo
DEMO_TEAM_ID = YOURTEAMID
Loading
Loading