-
Notifications
You must be signed in to change notification settings - Fork 0
feat: [SDK-4324] add Capacitor SPM example demo project #4
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
4 commits
Select commit
Hold shift + click to select a range
6f1f6e7
feat(demo): add Capacitor demo app (spm)
fadi-george cdd3ab4
feat(demo): add app ID to env example
fadi-george bc7f314
refactor(demo): add test IDs, remove LogView/LogManager
fadi-george 920be68
refactor(demo): remove Capacitor platform guards
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| VITE_ONESIGNAL_APP_ID=your_onesignal_app_id | ||
| VITE_ONESIGNAL_API_KEY=your_rest_api_key | ||
| VITE_E2E_MODE=false | ||
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,101 @@ | ||
| # Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore | ||
|
|
||
| # Built application files | ||
| *.apk | ||
| *.aar | ||
| *.ap_ | ||
| *.aab | ||
|
|
||
| # Files for the ART/Dalvik VM | ||
| *.dex | ||
|
|
||
| # Java class files | ||
| *.class | ||
|
|
||
| # Generated files | ||
| bin/ | ||
| gen/ | ||
| out/ | ||
| # Uncomment the following line in case you need and you don't have the release build type files in your app | ||
| # release/ | ||
|
|
||
| # Gradle files | ||
| .gradle/ | ||
| build/ | ||
|
|
||
| # Local configuration file (sdk path, etc) | ||
| local.properties | ||
|
|
||
| # Proguard folder generated by Eclipse | ||
| proguard/ | ||
|
|
||
| # Log Files | ||
| *.log | ||
|
|
||
| # Android Studio Navigation editor temp files | ||
| .navigation/ | ||
|
|
||
| # Android Studio captures folder | ||
| captures/ | ||
|
|
||
| # IntelliJ | ||
| *.iml | ||
| .idea/workspace.xml | ||
| .idea/tasks.xml | ||
| .idea/gradle.xml | ||
| .idea/assetWizardSettings.xml | ||
| .idea/dictionaries | ||
| .idea/libraries | ||
| # Android Studio 3 in .gitignore file. | ||
| .idea/caches | ||
| .idea/modules.xml | ||
| # Comment next line if keeping position of elements in Navigation Editor is relevant for you | ||
| .idea/navEditor.xml | ||
|
|
||
| # Keystore files | ||
| # Uncomment the following lines if you do not want to check your keystore files in. | ||
| #*.jks | ||
| #*.keystore | ||
|
|
||
| # External native build folder generated in Android Studio 2.2 and later | ||
| .externalNativeBuild | ||
| .cxx/ | ||
|
|
||
| # Google Services (e.g. APIs or Firebase) | ||
| # google-services.json | ||
|
|
||
| # Freeline | ||
| freeline.py | ||
| freeline/ | ||
| freeline_project_description.json | ||
|
|
||
| # fastlane | ||
| fastlane/report.xml | ||
| fastlane/Preview.html | ||
| fastlane/screenshots | ||
| fastlane/test_output | ||
| fastlane/readme.md | ||
|
|
||
| # Version control | ||
| vcs.xml | ||
|
|
||
| # lint | ||
| lint/intermediates/ | ||
| lint/generated/ | ||
| lint/outputs/ | ||
| lint/tmp/ | ||
| # lint/reports/ | ||
|
|
||
| # Android Profiling | ||
| *.hprof | ||
|
|
||
| # Cordova plugins for Capacitor | ||
| capacitor-cordova-android-plugins | ||
|
|
||
| # Copied web assets | ||
| app/src/main/assets/public | ||
|
|
||
| # Generated Config files | ||
| app/src/main/assets/capacitor.config.json | ||
| app/src/main/assets/capacitor.plugins.json | ||
| app/src/main/res/xml/config.xml |
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,2 @@ | ||
| /build/* | ||
| !/build/.npmkeep |
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,56 @@ | ||
| plugins { | ||
| id("com.android.application") | ||
| } | ||
|
|
||
| android { | ||
| namespace = "com.onesignal.example" | ||
| compileSdk = rootProject.extra["compileSdkVersion"] as Int | ||
| defaultConfig { | ||
| applicationId = "com.onesignal.example" | ||
| minSdk = rootProject.extra["minSdkVersion"] as Int | ||
| targetSdk = rootProject.extra["targetSdkVersion"] as Int | ||
| versionCode = 1 | ||
| versionName = "1.0" | ||
| testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
| androidResources { | ||
| // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. | ||
| // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 | ||
| ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" | ||
| } | ||
| } | ||
| buildTypes { | ||
| release { | ||
| isMinifyEnabled = false | ||
| proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| flatDir { | ||
| dirs("../capacitor-cordova-android-plugins/src/main/libs", "libs") | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) | ||
| implementation(libs.androidx.appcompat) | ||
| implementation(libs.androidx.coordinatorlayout) | ||
| implementation(libs.androidx.core.splashscreen) | ||
| implementation(project(":capacitor-android")) | ||
| testImplementation(libs.junit) | ||
| androidTestImplementation(libs.androidx.test.junit) | ||
| androidTestImplementation(libs.androidx.test.espresso.core) | ||
| implementation(project(":capacitor-cordova-android-plugins")) | ||
| } | ||
|
|
||
| apply(from = "capacitor.build.gradle") | ||
|
|
||
| try { | ||
| val servicesJSON = file("google-services.json") | ||
| if (servicesJSON.readText().isNotEmpty()) { | ||
| apply(plugin = "com.google.gms.google-services") | ||
| } | ||
| } catch (e: Exception) { | ||
| logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") | ||
| } |
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,21 @@ | ||
| # Add project specific ProGuard rules here. | ||
| # You can control the set of applied configuration files using the | ||
| # proguardFiles setting in build.gradle. | ||
| # | ||
| # For more details, see | ||
| # http://developer.android.com/guide/developing/tools/proguard.html | ||
|
|
||
| # If your project uses WebView with JS, uncomment the following | ||
| # and specify the fully qualified class name to the JavaScript interface | ||
| # class: | ||
| #-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| # public *; | ||
| #} | ||
|
|
||
| # Uncomment this to preserve the line number information for | ||
| # debugging stack traces. | ||
| #-keepattributes SourceFile,LineNumberTable | ||
|
|
||
| # If you keep the line number information, uncomment this to | ||
| # hide the original source file name. | ||
| #-renamesourcefileattribute SourceFile |
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,37 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <application | ||
| android:allowBackup="true" | ||
| android:icon="@mipmap/ic_launcher" | ||
| android:label="@string/app_name" | ||
| android:roundIcon="@mipmap/ic_launcher_round" | ||
| android:supportsRtl="true" | ||
| android:theme="@style/AppTheme"> | ||
| <activity | ||
| android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation|density" | ||
| android:name=".MainActivity" | ||
| android:label="@string/title_activity_main" | ||
| android:theme="@style/AppTheme.NoActionBarLaunch" | ||
| android:launchMode="singleTask" | ||
| android:exported="true"> | ||
| <intent-filter> | ||
| <action android:name="android.intent.action.MAIN" /> | ||
| <category android:name="android.intent.category.LAUNCHER" /> | ||
| </intent-filter> | ||
| </activity> | ||
|
|
||
| <provider | ||
| android:name="androidx.core.content.FileProvider" | ||
| android:authorities="${applicationId}.fileprovider" | ||
| android:exported="false" | ||
| android:grantUriPermissions="true"> | ||
| <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> | ||
| </provider> | ||
| </application> | ||
|
|
||
| <!-- Permissions --> | ||
|
|
||
| <uses-permission android:name="android.permission.INTERNET" /> | ||
| <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
| <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
| </manifest> |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these get referenced anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its for e2e and local testing