-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/deployment-firebase
- Loading branch information
Showing
24 changed files
with
451 additions
and
166 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,59 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
namespace "${APP_ID}" | ||
compileSdkVersion rootProject.ext.compileSdkVersion | ||
defaultConfig { | ||
applicationId "${APP_ID}" | ||
minSdkVersion rootProject.ext.minSdkVersion | ||
targetSdkVersion rootProject.ext.targetSdkVersion | ||
versionCode ${VERSION_CODE} | ||
versionName "${VERSION_NAME}" | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
flatDir{ | ||
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" | ||
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" | ||
implementation fileTree(include: ['*.jar'], dir: 'libs') | ||
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" | ||
implementation project(':capacitor-android') | ||
testImplementation "junit:junit:$junitVersion" | ||
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" | ||
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" | ||
implementation project(':capacitor-cordova-android-plugins') | ||
|
||
// Import the BoM for the Firebase platform | ||
implementation platform('com.google.firebase:firebase-bom:32.7.2') | ||
|
||
// Declare the dependencies for the Crashlytics and Analytics libraries | ||
// When using the BoM, you don't specify versions in Firebase library dependencies | ||
implementation 'com.google.firebase:firebase-crashlytics' | ||
implementation 'com.google.firebase:firebase-perf' | ||
} | ||
|
||
apply from: 'capacitor.build.gradle' | ||
|
||
try { | ||
def servicesJSON = file('google-services.json') | ||
if (servicesJSON.text) { | ||
apply plugin: 'com.google.gms.google-services' | ||
apply plugin: 'com.google.firebase.firebase-perf' // Firebase Performance Monitoring plugin | ||
apply plugin: 'com.google.firebase.crashlytics' // Firebase Crashlytics plugin | ||
} | ||
} catch(Exception e) { | ||
logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work") | ||
} |
This file contains 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,77 @@ | ||
<?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" android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true"> | ||
<!-- usesCleartextTraffic is required by capacitor-blob-writer --> | ||
<!-- requestLegacyExternalStorage is required to save files to "Documents" folder on Android 10 --> | ||
|
||
<activity android:exported="true" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:name="${APP_ID}.MainActivity" android:label="@string/title_activity_main" android:theme="@style/AppTheme.NoActionBarLaunch" android:launchMode="singleTask"> | ||
|
||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
|
||
<intent-filter> | ||
<action android:name="android.intent.action.VIEW" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
<category android:name="android.intent.category.BROWSABLE" /> | ||
<data android:scheme="@string/custom_url_scheme" /> | ||
</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"></meta-data> | ||
</provider> | ||
</application> | ||
|
||
<!-- Permissions --> | ||
|
||
<!-- CC NOTE - 2021-06-02 | ||
As we don't currrently need GeoLocation have removed permission | ||
(some installs on unsupported tester devices, e.g. Tecno-wx3p | ||
If we want to put back we should make non-required and add runtime check | ||
in the app before using feature (might require both uses-feature and uses-permission | ||
https://stackoverflow.com/questions/30391355/can-i-get-access-to-nfc-without-manifest-permission-in-android | ||
https://stackoverflow.com/questions/28079449/uses-permission-vs-uses-feature | ||
https://developer.android.com/guide/topics/manifest/uses-feature-element | ||
https://developer.android.com/guide/topics/manifest/uses-permission-element | ||
E.g. To enable camera include uses-permission for camera but manually add all features as optional | ||
https://developer.android.com/reference/android/Manifest.permission#CAMERA | ||
https://developer.android.com/guide/topics/manifest/uses-feature-element#camera-hw-features | ||
--> | ||
|
||
|
||
|
||
<!-- Normal permissions, granted at install, don't require prompt --> | ||
<!-- https://developer.android.com/training/basics/network-ops/connecting --> | ||
<!-- <uses-permission android:name="android.permission.INTERNET" /> --> | ||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> --> | ||
|
||
|
||
<!-- Requested permissions, required in the app --> | ||
<!-- Camera, Photos, input file --> | ||
<!-- <uses-permission android:required="false" android:name="android.permission.READ_EXTERNAL_STORAGE"/> --> | ||
<!-- <uses-permission android:required="false" android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> --> | ||
|
||
<!-- Navigator.getUserMedia --> | ||
<!-- Video --> | ||
<!-- <uses-permission android:required="false" android:name="android.permission.CAMERA" /> --> | ||
<!-- Audio --> | ||
<!-- <uses-permission android:required="false" android:name="android.permission.RECORD_AUDIO" /> --> | ||
<!-- <uses-permission android:required="false" android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> --> | ||
|
||
|
||
<!-- Optional permissions, features we might make optional --> | ||
|
||
<!-- <uses-feature android:name="android.hardware.location.gps" /> --> | ||
|
||
|
||
<!-- Not required permissions, features we have decided we don't want --> | ||
<!-- Geolocation API --> | ||
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> --> | ||
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> --> | ||
</manifest> |
This file was deleted.
Oops, something went wrong.
This file contains 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,15 @@ | ||
package ${APP_ID}; | ||
|
||
import android.os.Bundle; | ||
|
||
import com.getcapacitor.BridgeActivity; | ||
import com.getcapacitor.Plugin; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class MainActivity extends BridgeActivity { | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
} | ||
} |
This file contains 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,7 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<resources> | ||
<string name="app_name">${APP_NAME}</string> | ||
<string name="title_activity_main">${APP_NAME}</string> | ||
<string name="package_name">${APP_ID}</string> | ||
<string name="custom_url_scheme">${APP_ID}</string> | ||
</resources> |
This file contains 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,35 @@ | ||
/// <reference types="@capacitor/local-notifications" /> | ||
/// <reference types="@capacitor/splash-screen" /> | ||
|
||
import { CapacitorConfig } from "@capacitor/cli"; | ||
|
||
const config: CapacitorConfig = { | ||
appId: "${APP_ID}", | ||
appName: "${APP_NAME}", | ||
webDir: "www", | ||
plugins: { | ||
SplashScreen: { | ||
launchShowDuration: 7000, // app.component.ts should manually dismiss before duration | ||
launchAutoHide: true, | ||
androidScaleType: "CENTER_CROP", | ||
}, | ||
FirebaseAuthentication: { | ||
skipNativeAuth: false, | ||
providers: ["google.com"], | ||
}, | ||
}, | ||
server: { | ||
androidScheme: "http", | ||
/** | ||
* NOTE - to support live-reload on external device (e.g. emulator) | ||
* 1) Uncomment url and replace with local ip to serve live-reload on local device | ||
* 2) Sync to capacitor `npx cap sync` | ||
* 3) Serve via `yarn ng serve --configuration=external` | ||
* 4) Run app from android studio `npx cap open android` and run | ||
* Local browser (localhost:4000), device app and device browser ([ip]:4200) should all be able to access served app | ||
**/ | ||
// url: "http://192.168.50.67:4200", | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains 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 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 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.