, with event: UIEvent?) {
55 | super.touchesBegan(touches, with: event)
56 |
57 | let statusBarRect = UIApplication.shared.statusBarFrame
58 | guard let touchPoint = event?.allTouches?.first?.location(in: self.window) else { return }
59 |
60 | if statusBarRect.contains(touchPoint) {
61 | NotificationCenter.default.post(name: .capacitorStatusBarTapped, object: nil)
62 | }
63 | }
64 |
65 | #if USE_PUSH
66 |
67 | func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
68 | NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: deviceToken)
69 | }
70 |
71 | func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
72 | NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error)
73 | }
74 |
75 | #endif
76 |
77 | func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {
78 | // If you are receiving a notification message while your app is in the background,
79 | // this callback will not be fired till the user taps on the notification launching the application.
80 | // TODO: Handle data of notification
81 |
82 | // With swizzling disabled you must let Messaging know about the message, for Analytics
83 | // Messaging.messaging().appDidReceiveMessage(userInfo)
84 |
85 | // Print message ID.
86 | // if let messageID = userInfo[gcmMessageIDKey] {
87 | // print("Message ID: \(messageID)")
88 | // }
89 |
90 | // Print full message.
91 | print(userInfo)
92 | }
93 |
94 | func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
95 | fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
96 | // If you are receiving a notification message while your app is in the background,
97 | // this callback will not be fired till the user taps on the notification launching the application.
98 | // TODO: Handle data of notification
99 |
100 | // With swizzling disabled you must let Messaging know about the message, for Analytics
101 | // Messaging.messaging().appDidReceiveMessage(userInfo)
102 |
103 | // Print message ID.
104 | // if let messageID = userInfo[gcmMessageIDKey] {
105 | // print("Message ID: \(messageID)")
106 | // }
107 |
108 | // Print full message.
109 | print(userInfo)
110 |
111 | completionHandler(UIBackgroundFetchResult.newData)
112 | }
113 |
114 | }
115 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/example/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
3 | "version": 1,
4 | "defaultProject": "app",
5 | "newProjectRoot": "projects",
6 | "projects": {
7 | "app": {
8 | "root": "",
9 | "sourceRoot": "src",
10 | "projectType": "application",
11 | "prefix": "app",
12 | "schematics": {},
13 | "architect": {
14 | "build": {
15 | "builder": "@angular-devkit/build-angular:browser",
16 | "options": {
17 | "outputPath": "www",
18 | "index": "src/index.html",
19 | "main": "src/main.ts",
20 | "polyfills": "src/polyfills.ts",
21 | "tsConfig": "src/tsconfig.app.json",
22 | "assets": [
23 | {
24 | "glob": "**/*",
25 | "input": "src/assets",
26 | "output": "assets"
27 | },
28 | {
29 | "glob": "**/*.svg",
30 | "input": "node_modules/ionicons/dist/ionicons/svg",
31 | "output": "./svg"
32 | }
33 | ],
34 | "styles": [
35 | {
36 | "input": "src/theme/variables.scss"
37 | },
38 | {
39 | "input": "src/global.scss"
40 | },
41 | {
42 | "input": "src/app/app.scss"
43 | }
44 | ],
45 | "scripts": [],
46 | "es5BrowserSupport": true
47 | },
48 | "configurations": {
49 | "production": {
50 | "fileReplacements": [
51 | {
52 | "replace": "src/environments/environment.ts",
53 | "with": "src/environments/environment.prod.ts"
54 | }
55 | ],
56 | "optimization": true,
57 | "outputHashing": "all",
58 | "sourceMap": false,
59 | "extractCss": true,
60 | "namedChunks": false,
61 | "aot": true,
62 | "extractLicenses": true,
63 | "vendorChunk": false,
64 | "buildOptimizer": true,
65 | "budgets": [
66 | {
67 | "type": "initial",
68 | "maximumWarning": "2mb",
69 | "maximumError": "5mb"
70 | }
71 | ]
72 | },
73 | "ci": {
74 | "progress": false
75 | }
76 | }
77 | },
78 | "serve": {
79 | "builder": "@angular-devkit/build-angular:dev-server",
80 | "options": {
81 | "browserTarget": "app:build"
82 | },
83 | "configurations": {
84 | "production": {
85 | "browserTarget": "app:build:production"
86 | },
87 | "ci": {
88 | "progress": false
89 | }
90 | }
91 | },
92 | "extract-i18n": {
93 | "builder": "@angular-devkit/build-angular:extract-i18n",
94 | "options": {
95 | "browserTarget": "app:build"
96 | }
97 | },
98 | "test": {
99 | "builder": "@angular-devkit/build-angular:karma",
100 | "options": {
101 | "main": "src/test.ts",
102 | "polyfills": "src/polyfills.ts",
103 | "tsConfig": "src/tsconfig.spec.json",
104 | "karmaConfig": "src/karma.conf.js",
105 | "styles": [],
106 | "scripts": [],
107 | "assets": [
108 | {
109 | "glob": "favicon.ico",
110 | "input": "src/",
111 | "output": "/"
112 | },
113 | {
114 | "glob": "**/*",
115 | "input": "src/assets",
116 | "output": "/assets"
117 | }
118 | ]
119 | },
120 | "configurations": {
121 | "ci": {
122 | "progress": false,
123 | "watch": false
124 | }
125 | }
126 | },
127 | "lint": {
128 | "builder": "@angular-devkit/build-angular:tslint",
129 | "options": {
130 | "tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
131 | "exclude": ["**/node_modules/**"]
132 | }
133 | },
134 | "ionic-cordova-build": {
135 | "builder": "@ionic/angular-toolkit:cordova-build",
136 | "options": {
137 | "browserTarget": "app:build"
138 | },
139 | "configurations": {
140 | "production": {
141 | "browserTarget": "app:build:production"
142 | }
143 | }
144 | },
145 | "ionic-cordova-serve": {
146 | "builder": "@ionic/angular-toolkit:cordova-serve",
147 | "options": {
148 | "cordovaBuildTarget": "app:ionic-cordova-build",
149 | "devServerTarget": "app:serve"
150 | },
151 | "configurations": {
152 | "production": {
153 | "cordovaBuildTarget": "app:ionic-cordova-build:production",
154 | "devServerTarget": "app:serve:production"
155 | }
156 | }
157 | }
158 | }
159 | },
160 | "app-e2e": {
161 | "root": "e2e/",
162 | "projectType": "application",
163 | "architect": {
164 | "e2e": {
165 | "builder": "@angular-devkit/build-angular:protractor",
166 | "options": {
167 | "protractorConfig": "e2e/protractor.conf.js",
168 | "devServerTarget": "app:serve"
169 | },
170 | "configurations": {
171 | "production": {
172 | "devServerTarget": "app:serve:production"
173 | },
174 | "ci": {
175 | "devServerTarget": "app:serve:ci"
176 | }
177 | }
178 | },
179 | "lint": {
180 | "builder": "@angular-devkit/build-angular:tslint",
181 | "options": {
182 | "tsConfig": "e2e/tsconfig.e2e.json",
183 | "exclude": ["**/node_modules/**"]
184 | }
185 | }
186 | }
187 | }
188 | },
189 | "cli": {
190 | "defaultCollection": "@ionic/angular-toolkit"
191 | },
192 | "schematics": {
193 | "@ionic/angular-toolkit:component": {
194 | "styleext": "scss"
195 | },
196 | "@ionic/angular-toolkit:page": {
197 | "styleext": "scss"
198 | }
199 | }
200 | }
201 |
--------------------------------------------------------------------------------
/.all-contributorsrc:
--------------------------------------------------------------------------------
1 | {
2 | "projectName": "fcm",
3 | "projectOwner": "capacitor-community",
4 | "repoType": "github",
5 | "repoHost": "https://github.com",
6 | "files": [
7 | "README.md"
8 | ],
9 | "imageSize": 75,
10 | "commit": true,
11 | "commitConvention": "angular",
12 | "badgeTemplate": "
-orange?style=flat-square\" />",
13 | "contributors": [
14 | {
15 | "login": "stewones",
16 | "name": "stewones",
17 | "avatar_url": "https://avatars1.githubusercontent.com/u/719763?v=4",
18 | "profile": "https://twitter.com/stewones",
19 | "contributions": [
20 | "code",
21 | "doc"
22 | ]
23 | },
24 | {
25 | "login": "danielprrazevedo",
26 | "name": "Daniel Pereira",
27 | "avatar_url": "https://avatars2.githubusercontent.com/u/20153661?v=4",
28 | "profile": "https://github.com/danielprrazevedo",
29 | "contributions": [
30 | "code",
31 | "doc"
32 | ]
33 | },
34 | {
35 | "login": "priyankpat",
36 | "name": "Priyank Patel",
37 | "avatar_url": "https://avatars3.githubusercontent.com/u/5585797?v=4",
38 | "profile": "http://priyankpatel.io/",
39 | "contributions": [
40 | "code"
41 | ]
42 | },
43 | {
44 | "login": "nikoskip",
45 | "name": "Nikolas",
46 | "avatar_url": "https://avatars1.githubusercontent.com/u/1230033?v=4",
47 | "profile": "http://fuubar.wordpress.com/",
48 | "contributions": [
49 | "maintenance"
50 | ]
51 | },
52 | {
53 | "login": "lights0123",
54 | "name": "Ben Schattinger",
55 | "avatar_url": "https://avatars3.githubusercontent.com/u/3756309?v=4",
56 | "profile": "https://lights0123.com/",
57 | "contributions": [
58 | "code"
59 | ]
60 | },
61 | {
62 | "login": "jmannau",
63 | "name": "James Manners",
64 | "avatar_url": "https://avatars2.githubusercontent.com/u/175909?v=4",
65 | "profile": "https://binary.com.au/",
66 | "contributions": [
67 | "code"
68 | ]
69 | },
70 | {
71 | "login": "borodiliz",
72 | "name": "Borja Rodríguez",
73 | "avatar_url": "https://avatars3.githubusercontent.com/u/2467193?v=4",
74 | "profile": "https://github.com/borodiliz",
75 | "contributions": [
76 | "maintenance"
77 | ]
78 | },
79 | {
80 | "login": "Karrlllis",
81 | "name": "Karrlllis",
82 | "avatar_url": "https://avatars1.githubusercontent.com/u/37330643?v=4",
83 | "profile": "https://github.com/Karrlllis",
84 | "contributions": [
85 | "doc"
86 | ]
87 | },
88 | {
89 | "login": "jamesmah",
90 | "name": "jamesmah",
91 | "avatar_url": "https://avatars0.githubusercontent.com/u/21981049?v=4",
92 | "profile": "https://github.com/jamesmah",
93 | "contributions": [
94 | "code"
95 | ]
96 | },
97 | {
98 | "login": "josh-m-sharpe",
99 | "name": "Josh Sharpe",
100 | "avatar_url": "https://avatars3.githubusercontent.com/u/39473?v=4",
101 | "profile": "https://github.com/josh-m-sharpe",
102 | "contributions": [
103 | "maintenance"
104 | ]
105 | },
106 | {
107 | "login": "msimkunas",
108 | "name": "Mantas Šimkūnas",
109 | "avatar_url": "https://avatars.githubusercontent.com/u/9675250?v=4",
110 | "profile": "https://github.com/msimkunas",
111 | "contributions": [
112 | "code",
113 | "doc"
114 | ]
115 | },
116 | {
117 | "login": "iOlivier",
118 | "name": "Olivier Overstraete",
119 | "avatar_url": "https://avatars.githubusercontent.com/u/12254953?v=4",
120 | "profile": "https://github.com/iOlivier",
121 | "contributions": [
122 | "maintenance"
123 | ]
124 | },
125 | {
126 | "login": "hemangsk",
127 | "name": "Hemang Kumar",
128 | "avatar_url": "https://avatars.githubusercontent.com/u/13018570?v=4",
129 | "profile": "https://hemang.dev/",
130 | "contributions": [
131 | "code",
132 | "maintenance"
133 | ]
134 | },
135 | {
136 | "login": "mesqueeb",
137 | "name": "Luca Ban",
138 | "avatar_url": "https://avatars.githubusercontent.com/u/3253920?v=4",
139 | "profile": "https://github.com/mesqueeb",
140 | "contributions": [
141 | "doc"
142 | ]
143 | },
144 | {
145 | "login": "halomademeapc",
146 | "name": "Alex Griffith",
147 | "avatar_url": "https://avatars.githubusercontent.com/u/5904472?v=4",
148 | "profile": "https://www.alexgriffith.me/",
149 | "contributions": [
150 | "code",
151 | "maintenance"
152 | ]
153 | },
154 | {
155 | "login": "bdirito",
156 | "name": "bdirito",
157 | "avatar_url": "https://avatars.githubusercontent.com/u/8117238?v=4",
158 | "profile": "https://github.com/bdirito",
159 | "contributions": [
160 | "maintenance"
161 | ]
162 | },
163 | {
164 | "login": "mineminemine",
165 | "name": "Ryan",
166 | "avatar_url": "https://avatars.githubusercontent.com/u/17585549?v=4",
167 | "profile": "https://github.com/mineminemine",
168 | "contributions": [
169 | "maintenance"
170 | ]
171 | },
172 | {
173 | "login": "josuelmm",
174 | "name": "Josué Moreno",
175 | "avatar_url": "https://avatars.githubusercontent.com/u/12968781?v=4",
176 | "profile": "https://github.com/josuelmm",
177 | "contributions": [
178 | "code"
179 | ]
180 | },
181 | {
182 | "login": "marcjulian",
183 | "name": "Marc",
184 | "avatar_url": "https://avatars.githubusercontent.com/u/8985933?v=4",
185 | "profile": "https://marcjulian.de/?ref=github",
186 | "contributions": [
187 | "maintenance"
188 | ]
189 | },
190 | {
191 | "login": "flogy",
192 | "name": "Florian Gyger",
193 | "avatar_url": "https://avatars.githubusercontent.com/u/1215256?v=4",
194 | "profile": "https://floriangyger.ch/",
195 | "contributions": [
196 | "code"
197 | ]
198 | },
199 | {
200 | "login": "jcesarmobile",
201 | "name": "jcesarmobile",
202 | "avatar_url": "https://avatars.githubusercontent.com/u/1637892?v=4",
203 | "profile": "http://www.jcesarmobile.com/",
204 | "contributions": [
205 | "question",
206 | "doc",
207 | "maintenance"
208 | ]
209 | },
210 | {
211 | "login": "ramikhafagi96",
212 | "name": "Rami Khafagi",
213 | "avatar_url": "https://avatars.githubusercontent.com/u/38646828?v=4",
214 | "profile": "https://github.com/ramikhafagi96",
215 | "contributions": [
216 | "code"
217 | ]
218 | },
219 | {
220 | "login": "bipoza",
221 | "name": "Bittor Poza",
222 | "avatar_url": "https://avatars.githubusercontent.com/u/26112509?v=4",
223 | "profile": "https://github.com/bipoza",
224 | "contributions": [
225 | "code"
226 | ]
227 | },
228 | {
229 | "login": "Vishal-Isharani",
230 | "name": "Vishal Isharani",
231 | "avatar_url": "https://avatars.githubusercontent.com/u/10386581?v=4",
232 | "profile": "https://github.com/Vishal-Isharani",
233 | "contributions": [
234 | "maintenance",
235 | "code"
236 | ]
237 | },
238 | {
239 | "login": "kashz",
240 | "name": "Shunta KARASAWA",
241 | "avatar_url": "https://avatars.githubusercontent.com/u/12661101?v=4",
242 | "profile": "https://github.com/kashz",
243 | "contributions": [
244 | "maintenance"
245 | ]
246 | },
247 | {
248 | "login": "chrisweight",
249 | "name": "Chris Weight",
250 | "avatar_url": "https://avatars.githubusercontent.com/u/468638?v=4",
251 | "profile": "http://www.chrisweight.com/",
252 | "contributions": [
253 | "maintenance"
254 | ]
255 | },
256 | {
257 | "login": "ViMaSter",
258 | "name": "Vincent Mahnke",
259 | "avatar_url": "https://avatars.githubusercontent.com/u/1689033?v=4",
260 | "profile": "https://by.vincent.mahn.ke/",
261 | "contributions": [
262 | "maintenance"
263 | ]
264 | },
265 | {
266 | "login": "tompidom",
267 | "name": "tompidom",
268 | "avatar_url": "https://avatars.githubusercontent.com/u/47992794?v=4",
269 | "profile": "https://github.com/tompidom",
270 | "contributions": [
271 | "infra"
272 | ]
273 | }
274 | ],
275 | "contributorsPerLine": 5
276 | }
277 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Copyright © 2015-2021 the original authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | # SPDX-License-Identifier: Apache-2.0
19 | #
20 |
21 | ##############################################################################
22 | #
23 | # Gradle start up script for POSIX generated by Gradle.
24 | #
25 | # Important for running:
26 | #
27 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
28 | # noncompliant, but you have some other compliant shell such as ksh or
29 | # bash, then to run this script, type that shell name before the whole
30 | # command line, like:
31 | #
32 | # ksh Gradle
33 | #
34 | # Busybox and similar reduced shells will NOT work, because this script
35 | # requires all of these POSIX shell features:
36 | # * functions;
37 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
38 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
39 | # * compound commands having a testable exit status, especially «case»;
40 | # * various built-in commands including «command», «set», and «ulimit».
41 | #
42 | # Important for patching:
43 | #
44 | # (2) This script targets any POSIX shell, so it avoids extensions provided
45 | # by Bash, Ksh, etc; in particular arrays are avoided.
46 | #
47 | # The "traditional" practice of packing multiple parameters into a
48 | # space-separated string is a well documented source of bugs and security
49 | # problems, so this is (mostly) avoided, by progressively accumulating
50 | # options in "$@", and eventually passing that to Java.
51 | #
52 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
53 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
54 | # see the in-line comments for details.
55 | #
56 | # There are tweaks for specific operating systems such as AIX, CygWin,
57 | # Darwin, MinGW, and NonStop.
58 | #
59 | # (3) This script is generated from the Groovy template
60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
61 | # within the Gradle project.
62 | #
63 | # You can find Gradle at https://github.com/gradle/gradle/.
64 | #
65 | ##############################################################################
66 |
67 | # Attempt to set APP_HOME
68 |
69 | # Resolve links: $0 may be a link
70 | app_path=$0
71 |
72 | # Need this for daisy-chained symlinks.
73 | while
74 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
75 | [ -h "$app_path" ]
76 | do
77 | ls=$( ls -ld "$app_path" )
78 | link=${ls#*' -> '}
79 | case $link in #(
80 | /*) app_path=$link ;; #(
81 | *) app_path=$APP_HOME$link ;;
82 | esac
83 | done
84 |
85 | # This is normally unused
86 | # shellcheck disable=SC2034
87 | APP_BASE_NAME=${0##*/}
88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90 | ' "$PWD" ) || exit
91 |
92 | # Use the maximum available, or set MAX_FD != -1 to use that value.
93 | MAX_FD=maximum
94 |
95 | warn () {
96 | echo "$*"
97 | } >&2
98 |
99 | die () {
100 | echo
101 | echo "$*"
102 | echo
103 | exit 1
104 | } >&2
105 |
106 | # OS specific support (must be 'true' or 'false').
107 | cygwin=false
108 | msys=false
109 | darwin=false
110 | nonstop=false
111 | case "$( uname )" in #(
112 | CYGWIN* ) cygwin=true ;; #(
113 | Darwin* ) darwin=true ;; #(
114 | MSYS* | MINGW* ) msys=true ;; #(
115 | NONSTOP* ) nonstop=true ;;
116 | esac
117 |
118 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
119 |
120 |
121 | # Determine the Java command to use to start the JVM.
122 | if [ -n "$JAVA_HOME" ] ; then
123 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
124 | # IBM's JDK on AIX uses strange locations for the executables
125 | JAVACMD=$JAVA_HOME/jre/sh/java
126 | else
127 | JAVACMD=$JAVA_HOME/bin/java
128 | fi
129 | if [ ! -x "$JAVACMD" ] ; then
130 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
131 |
132 | Please set the JAVA_HOME variable in your environment to match the
133 | location of your Java installation."
134 | fi
135 | else
136 | JAVACMD=java
137 | if ! command -v java >/dev/null 2>&1
138 | then
139 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
140 |
141 | Please set the JAVA_HOME variable in your environment to match the
142 | location of your Java installation."
143 | fi
144 | fi
145 |
146 | # Increase the maximum file descriptors if we can.
147 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
148 | case $MAX_FD in #(
149 | max*)
150 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
151 | # shellcheck disable=SC2039,SC3045
152 | MAX_FD=$( ulimit -H -n ) ||
153 | warn "Could not query maximum file descriptor limit"
154 | esac
155 | case $MAX_FD in #(
156 | '' | soft) :;; #(
157 | *)
158 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
159 | # shellcheck disable=SC2039,SC3045
160 | ulimit -n "$MAX_FD" ||
161 | warn "Could not set maximum file descriptor limit to $MAX_FD"
162 | esac
163 | fi
164 |
165 | # Collect all arguments for the java command, stacking in reverse order:
166 | # * args from the command line
167 | # * the main class name
168 | # * -classpath
169 | # * -D...appname settings
170 | # * --module-path (only if needed)
171 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
172 |
173 | # For Cygwin or MSYS, switch paths to Windows format before running java
174 | if "$cygwin" || "$msys" ; then
175 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
176 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
177 |
178 | JAVACMD=$( cygpath --unix "$JAVACMD" )
179 |
180 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
181 | for arg do
182 | if
183 | case $arg in #(
184 | -*) false ;; # don't mess with options #(
185 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
186 | [ -e "$t" ] ;; #(
187 | *) false ;;
188 | esac
189 | then
190 | arg=$( cygpath --path --ignore --mixed "$arg" )
191 | fi
192 | # Roll the args list around exactly as many times as the number of
193 | # args, so each arg winds up back in the position where it started, but
194 | # possibly modified.
195 | #
196 | # NB: a `for` loop captures its iteration list before it begins, so
197 | # changing the positional parameters here affects neither the number of
198 | # iterations, nor the values presented in `arg`.
199 | shift # remove old arg
200 | set -- "$@" "$arg" # push replacement arg
201 | done
202 | fi
203 |
204 |
205 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
206 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
207 |
208 | # Collect all arguments for the java command:
209 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210 | # and any embedded shellness will be escaped.
211 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212 | # treated as '${Hostname}' itself on the command line.
213 |
214 | set -- \
215 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
216 | -classpath "$CLASSPATH" \
217 | org.gradle.wrapper.GradleWrapperMain \
218 | "$@"
219 |
220 | # Stop when "xargs" is not available.
221 | if ! command -v xargs >/dev/null 2>&1
222 | then
223 | die "xargs is not available"
224 | fi
225 |
226 | # Use "xargs" to parse quoted args.
227 | #
228 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
229 | #
230 | # In Bash we could simply go:
231 | #
232 | # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
233 | # set -- "${ARGS[@]}" "$@"
234 | #
235 | # but POSIX shell has neither arrays nor command substitution, so instead we
236 | # post-process each arg (as a line of input to sed) to backslash-escape any
237 | # character that might be a shell metacharacter, then use eval to reverse
238 | # that process (while maintaining the separation between arguments), and wrap
239 | # the whole thing up as a single "set" statement.
240 | #
241 | # This will of course break if any of these variables contains a newline or
242 | # an unmatched quote.
243 | #
244 |
245 | eval "set -- $(
246 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
247 | xargs -n1 |
248 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
249 | tr '\n' ' '
250 | )" '"$@"'
251 |
252 | exec "$JAVACMD" "$@"
253 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4 |
5 | ### [8.0.1](https://github.com/capacitor-community/fcm/compare/v8.0.0...v8.0.1) (2025-12-04)
6 |
7 |
8 | ### Bug Fixes
9 |
10 | * keep ios 14 support for now and pin firebase to 11 ([33315ee](https://github.com/capacitor-community/fcm/commit/33315ee3acbd75418085dbc9521b86f763c610ab))
11 |
12 | ## [8.0.0](https://github.com/capacitor-community/fcm/compare/v7.3.0...v8.0.0) (2025-12-04)
13 |
14 | ### Features
15 |
16 | * iOS Swift Package definition ([#182](https://github.com/capacitor-community/fcm/issues/182)) ([bdfc5d7](https://github.com/capacitor-community/fcm/commit/bdfc5d7b669156be8483df03144aee7d4c47a45d))
17 |
18 |
19 | ### [7.1.3](https://github.com/capacitor-community/fcm/compare/v7.1.1...v7.1.3) (2025-08-23)
20 |
21 |
22 | ### Bug Fixes
23 |
24 | * revert mistake closes [#180](https://github.com/capacitor-community/fcm/issues/180) ([5515b06](https://github.com/capacitor-community/fcm/commit/5515b0662fe2ebdded9f318d7ebd3745501a9a55))
25 |
26 | ### [7.1.1](https://github.com/capacitor-community/fcm/compare/v7.1.0...v7.1.1) (2025-03-18)
27 |
28 |
29 | ### Bug Fixes
30 |
31 | * Remove res folder ([#174](https://github.com/capacitor-community/fcm/issues/174)) ([aeb4fa5](https://github.com/capacitor-community/fcm/commit/aeb4fa574910744e7ed631b6213d1c6ebfa5055a))
32 |
33 | ## [7.1.0](https://github.com/capacitor-community/fcm/compare/v7.0.0...v7.1.0) (2025-03-06)
34 |
35 | ## [7.0.0](https://github.com/capacitor-community/fcm/compare/v6.0.1...v7.0.0) (2025-02-04)
36 |
37 |
38 | ### Features
39 |
40 | * update to Capacitor 7 ([#166](https://github.com/capacitor-community/fcm/issues/166)) ([df01cbb](https://github.com/capacitor-community/fcm/commit/df01cbbd3fb7c03d2d7c2ae00484f314cedc3d2a))
41 |
42 | ### [6.0.1](https://github.com/capacitor-community/fcm/compare/v6.0.0...v6.0.1) (2025-02-02)
43 |
44 |
45 | ### Bug Fixes
46 |
47 | * Reset fcmToken var when deleteInstance method called. ([#165](https://github.com/capacitor-community/fcm/issues/165)) ([46e8bf2](https://github.com/capacitor-community/fcm/commit/46e8bf2fd15b583c38fb8659ead7223892dcab4e))
48 |
49 | ## [6.0.0](https://github.com/capacitor-community/fcm/compare/v5.0.3...v6.0.0) (2024-05-23)
50 |
51 |
52 | ### Features
53 |
54 | * update to Capacitor 6 ([#158](https://github.com/capacitor-community/fcm/issues/158)) ([871eb53](https://github.com/capacitor-community/fcm/commit/871eb530c72ef5be2e732678324003bcba96431a))
55 |
56 | ### [5.0.3](https://github.com/capacitor-community/fcm/compare/v5.0.2...v5.0.3) (2024-02-20)
57 |
58 |
59 | ### Bug Fixes
60 |
61 | * Add refreshToken method to Plugin.m ([#155](https://github.com/capacitor-community/fcm/issues/155)) ([72da269](https://github.com/capacitor-community/fcm/commit/72da269fd6917f3123eb394233a412ccd8a9edab))
62 |
63 | ### [5.0.2](https://github.com/capacitor-community/fcm/compare/v5.0.1...v5.0.2) (2023-08-29)
64 |
65 | ### [5.0.1](https://github.com/capacitor-community/fcm/compare/v5.0.0...v5.0.1) (2023-05-08)
66 |
67 |
68 | ### Bug Fixes
69 |
70 | * Use Capacitor ^5.0.0 instead of next ([#145](https://github.com/capacitor-community/fcm/issues/145)) ([d8f6354](https://github.com/capacitor-community/fcm/commit/d8f6354d8d7c5d83df0cfc6d8d391c0638081e8b))
71 |
72 | ## [5.0.0](https://github.com/capacitor-community/fcm/compare/v4.0.0...v5.0.0) (2023-05-08)
73 |
74 | ## [4.0.0](https://github.com/capacitor-community/fcm/compare/v3.0.2...v4.0.0) (2023-05-08)
75 |
76 |
77 | ### ⚠ BREAKING CHANGES
78 |
79 | * Update to Capacitor 5 (#144)
80 |
81 | ### Features
82 |
83 | * Update to Capacitor 5 ([#144](https://github.com/capacitor-community/fcm/issues/144)) ([b453adb](https://github.com/capacitor-community/fcm/commit/b453adbcf358dccd3cdc2ddb0fa485d5d14ba0c4))
84 |
85 | ### [3.0.2](https://github.com/capacitor-community/fcm/compare/v3.0.1...v3.0.2) (2022-12-07)
86 |
87 |
88 | ### Bug Fixes
89 |
90 | * check if task is successful before accessing result to avoid crashes ([0304daa](https://github.com/capacitor-community/fcm/commit/0304daa54d25305a166661d9040bd7cb107261da))
91 |
92 | ### [3.0.1](https://github.com/capacitor-community/fcm/compare/v3.0.0...v3.0.1) (2022-11-08)
93 |
94 |
95 | ### Bug Fixes
96 |
97 | * add sponsor ([e2270f6](https://github.com/capacitor-community/fcm/commit/e2270f607287fa1440c5150de57e93f4d52f42d6))
98 | * **android:** update firebaseMessagingVersion default value ([445b8ac](https://github.com/capacitor-community/fcm/commit/445b8ac805daf3ac52c3ccf0e4b89ed0e93a012d))
99 | * readme ([1cbc83c](https://github.com/capacitor-community/fcm/commit/1cbc83c7825395ea7310814fa70ed1fd0ca809bb))
100 |
101 | ### [2.0.2](https://github.com/capacitor-community/fcm/compare/v2.0.1...v2.0.2) (2021-10-04)
102 |
103 | ### [2.0.1](https://github.com/capacitor-community/fcm/compare/v2.0.0...v2.0.1) (2021-09-13)
104 |
105 | ## [2.0.0](https://github.com/capacitor-community/fcm/compare/v1.1.2...v2.0.0) (2021-06-14)
106 |
107 |
108 | ### Bug Fixes
109 |
110 | * upgrade to firebase 8 and fix plugin for capacitor 3 ([3317a8e](https://github.com/capacitor-community/fcm/commit/3317a8e9824b2dbf7d179410a31d7494669f0c51))
111 |
112 | ### [1.1.2](https://github.com/capacitor-community/fcm/compare/v1.1.0...v1.1.2) (2021-06-11)
113 |
114 |
115 | ### Bug Fixes
116 |
117 | * maintenance badge ([d91eff2](https://github.com/capacitor-community/fcm/commit/d91eff2c32d66bb4a43927b8026d66490098f656))
118 | * no need of Firebase/Core ([38f186b](https://github.com/capacitor-community/fcm/commit/38f186b09525ee681360b4437ed38c1cc57cb981))
119 | * podspec ([a3fa50a](https://github.com/capacitor-community/fcm/commit/a3fa50ae039f6a5680d7dd5094675e6ee5a436eb))
120 | * tweak demo for capacitor v2 ([397409c](https://github.com/capacitor-community/fcm/commit/397409c85881a81fa953f8d51746528ae045587b))
121 |
122 | ### [1.1.1](https://github.com/capacitor-community/fcm/compare/v1.1.0...v1.1.1) (2021-05-23)
123 |
124 |
125 | ### Bug Fixes
126 |
127 | * no need of Firebase/Core ([38f186b](https://github.com/capacitor-community/fcm/commit/38f186b09525ee681360b4437ed38c1cc57cb981))
128 | * tweak demo for capacitor v2 ([397409c](https://github.com/capacitor-community/fcm/commit/397409c85881a81fa953f8d51746528ae045587b))
129 |
130 | ## [1.1.0](https://github.com/capacitor-community/fcm/compare/v1.0.8...v1.1.0) (2021-02-15)
131 |
132 | ### [1.0.8](https://github.com/capacitor-community/fcm/compare/v1.0.7...v1.0.8) (2020-07-11)
133 |
134 | ### Bug Fixes
135 |
136 | - **ios:** get token using instanceID ([f62d33c](https://github.com/capacitor-community/fcm/commit/f62d33cb77e9ce071e2effa71063a740efd9d406))
137 |
138 | ### [1.0.7](https://github.com/capacitor-community/fcm/compare/v1.0.6...v1.0.7) (2020-07-02)
139 |
140 | - use 2.0.0 instead of latest in package.json
141 |
142 | ### [1.0.6](https://github.com/capacitor-community/fcm/compare/v1.0.5...v1.0.6) (2020-06-29)
143 |
144 | ### Features
145 |
146 | - add example ([1304c79](https://github.com/capacitor-community/fcm/commit/1304c79cf60c772589f2421ff292eac77480887b))
147 |
148 | ### Bug Fixes
149 |
150 | - **android:** java path ([70a0c9a](https://github.com/capacitor-community/fcm/commit/70a0c9a952f19210e6c237fe9489ddeb3562acc2))
151 |
152 | ### [1.0.5](https://github.com/capacitor-community/fcm/compare/v1.0.4...v1.0.5) (2020-06-29)
153 |
154 | ### Bug Fixes
155 |
156 | - **android:** refactoring to match community standards. closes [#43](https://github.com/capacitor-community/fcm/issues/43) [#44](https://github.com/capacitor-community/fcm/issues/44) ([11761b8](https://github.com/capacitor-community/fcm/commit/11761b8f024422f89288f940c8a6a146b3ff9a5e))
157 |
158 | ### [1.0.4](https://github.com/capacitor-community/fcm/compare/v1.0.3...v1.0.4) (2020-06-27)
159 |
160 | ### Bug Fixes
161 |
162 | - contributor links ([73aa017](https://github.com/capacitor-community/fcm/commit/73aa01789a2356711542503c2b864653855c8a50))
163 |
164 | ### [1.0.3](https://github.com/capacitor-community/fcm/compare/v1.0.2...v1.0.3) (2020-06-27)
165 |
166 | ### [1.0.2](https://github.com/capacitor-community/fcm/compare/v1.0.1...v1.0.2) (2020-06-27)
167 |
168 | ### Bug Fixes
169 |
170 | - podspec name ([1ccad9b](https://github.com/capacitor-community/fcm/commit/1ccad9b45a9462b5315f0e32612696a32dcbecd2))
171 |
172 | ### [1.0.1](https://github.com/capacitor-community/fcm/compare/v1.0.0...v1.0.1) (2020-06-27)
173 |
174 | ### Bug Fixes
175 |
176 | - **ios:** Fixing wrong Firebase dependency ([6e96be0](https://github.com/capacitor-community/fcm/commit/6e96be0388e67c28c389debd26a11ed3b145e4af))
177 |
178 | ## 1.0.0 (2020-06-27)
179 |
180 | ### Features
181 |
182 | - **README:** add androidy notes ([9042cba](https://github.com/capacitor-community/fcm/commit/9042cba2bf1182bb0542177ba8fd1303b492009b))
183 | - add android support ([f3caba1](https://github.com/capacitor-community/fcm/commit/f3caba115a593a9fbb918ee63c2427c3ce5d0870))
184 | - **FCM:** add subscribe to topic ([6f0f88d](https://github.com/capacitor-community/fcm/commit/6f0f88db173a726ae4b412bfe9b0333f296ed327))
185 | - **ios:** add getToken and clean project to be publish ([ddec39b](https://github.com/capacitor-community/fcm/commit/ddec39b666e3338a5dd73b39c33510c2eb84c4e7))
186 | - add README ([863cb25](https://github.com/capacitor-community/fcm/commit/863cb25361fb7ecd8dcd63c64f7181f9d7f5b72f))
187 | - add unsubscribe from topic ([a6a3dee](https://github.com/capacitor-community/fcm/commit/a6a3dee09b5b2faaca01e50fc2cedb1992df41d5))
188 |
189 | ### Bug Fixes
190 |
191 | - **android:** add app compat ([5709b1d](https://github.com/capacitor-community/fcm/commit/5709b1dadbd62d1f62b0be86bb1229e9f4e9bc5f))
192 | - **android:** add deps ([9927aee](https://github.com/capacitor-community/fcm/commit/9927aeee0637945520bea03b69f609a0806b5767))
193 | - **android:** cap implementation ([b394973](https://github.com/capacitor-community/fcm/commit/b3949730c7ff27afb3a5f4a94dce60360590acde))
194 | - **android:** package name ([f148a20](https://github.com/capacitor-community/fcm/commit/f148a203551e457a89eed8fedaf24c8fe925b88a))
195 | - **ios:** notifications were not being delivered on a freshed app install ([f3d10a5](https://github.com/capacitor-community/fcm/commit/f3d10a59a866c0c92cbfd91a3a400c6126de03cb))
196 | - **ios:** notifications were not being delivered on a freshed app install ([3205224](https://github.com/capacitor-community/fcm/commit/3205224885465a186a830c9679f4b3ce5abdb321))
197 | - **ios:** plugin not working on Case-Sensitive file system ([1deb869](https://github.com/capacitor-community/fcm/commit/1deb86951dc23a337a7910f5df1bba7e48005d72))
198 | - **podspec:** add firebase back ([933ddbe](https://github.com/capacitor-community/fcm/commit/933ddbed2b168e2552aae7138914e7ed54d59492))
199 | - **README:** add sample app link ([ef67512](https://github.com/capacitor-community/fcm/commit/ef67512f94ffb317464006b1eb71a619a9e45079))
200 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |

2 | Capacitor FCM
3 | @capacitor-community/fcm
4 |
5 | Capacitor community plugin for enabling FCM capabilities
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | ## Maintainers
21 |
22 | | Maintainer | GitHub | Social |
23 | | ------------ | --------------------------------------- | ----------------------------------------- |
24 | | Stewan Silva | [stewones](https://github.com/stewones) | [@stewones](https://x.com/stewones) |
25 |
26 | ## Notice 🚀
27 |
28 | We're starting fresh under an official org. If you were using the previous npm package `capacitor-fcm`, please update your package.json to `@capacitor-community/fcm`. Check out [changelog](/CHANGELOG.md) for more info.
29 |
30 | ## Installation
31 |
32 | Using npm:
33 |
34 | ```bash
35 | npm install @capacitor-community/fcm
36 | ```
37 |
38 | Using yarn:
39 |
40 | ```bash
41 | yarn add @capacitor-community/fcm
42 | ```
43 |
44 | Sync native files:
45 |
46 | ```bash
47 | npx cap sync
48 | ```
49 |
50 | > ### Notice
51 | >
52 | > This plugin is intended to be used combined with Capacitor API for [Push Notifications](https://capacitor.ionicframework.com/docs/apis/push-notifications). Capacitor only provides APN token whereas this plugin offers the possibility to work with FCM tokens and more.
53 |
54 | ## API
55 |
56 | | method | info | platform |
57 | | ------------------- | --------------------------------------------- | ----------- |
58 | | `subscribeTo` | subscribe to fcm topic | ios/android |
59 | | `unsubscribeFrom` | unsubscribe from fcm topic | ios/android |
60 | | `getToken` | get fcm token to eventually use from a server | ios/android |
61 | | `refreshToken` | refresh fcm token to get a new one | ios/android |
62 | | `deleteInstance` | remove local fcm instance completely | ios/android |
63 | | `setAutoInit` | enable the auto initialization of the library | ios/android |
64 | | `isAutoInitEnabled` | check whether auto initialization is enabled | ios/android |
65 |
66 | ## Usage
67 |
68 | ```ts
69 | import { FCM } from '@capacitor-community/fcm';
70 | import { PushNotifications } from '@capacitor/push-notifications';
71 |
72 | // external required step
73 | // register for push
74 | await PushNotifications.requestPermissions();
75 | await PushNotifications.register();
76 |
77 | // now you can subscribe to a specific topic
78 | FCM.subscribeTo({ topic: 'test' })
79 | .then(r => alert(`subscribed to topic`))
80 | .catch(err => console.log(err));
81 |
82 | // Unsubscribe from a specific topic
83 | FCM.unsubscribeFrom({ topic: 'test' })
84 | .then(() => alert(`unsubscribed from topic`))
85 | .catch(err => console.log(err));
86 |
87 | // Get FCM token instead of the APN one returned by Capacitor
88 | FCM.getToken()
89 | .then(r => alert(`Token ${r.token}`))
90 | .catch(err => console.log(err));
91 |
92 | // Delete the old FCM token and get a new one
93 | FCM.refreshToken()
94 | .then(r => alert(`Token ${r.token}`))
95 | .catch(err => console.log(err));
96 |
97 | // Remove FCM instance
98 | FCM.deleteInstance()
99 | .then(() => alert(`Token deleted`))
100 | .catch(err => console.log(err));
101 |
102 | // Enable the auto initialization of the library
103 | FCM.setAutoInit({ enabled: true }).then(() => alert(`Auto init enabled`));
104 |
105 | // Check the auto initialization status
106 | FCM.isAutoInitEnabled().then(r => {
107 | console.log('Auto init is ' + (r.enabled ? 'enabled' : 'disabled'));
108 | });
109 | ```
110 |
111 | ## Add Google config files
112 |
113 | Navigate to the project settings page for your app on Firebase.
114 |
115 | ### iOS
116 |
117 | Download the `GoogleService-Info.plist` file. In Xcode right-click on the yellow folder named "App" and select the `Add files to "App"`.
118 |
119 | > Tip: if you drag and drop your file to this location, Xcode may not be able to find it.
120 |
121 | ### Android
122 |
123 | Download the `google-services.json` file and copy it to `android/app/` directory of your capacitor project.
124 |
125 | ### Certificate
126 |
127 | - apple
128 | - create an app identifier (apple site)
129 | - add push notifications
130 | - add signing request (https://developer.apple.com/help/account/certificates/create-a-certificate-signing-request)
131 | - generate an APN key and then note down the ID displayed. also download the p8 file (https://fluffy.es/p8-push-notification/)
132 | - firebase
133 | - add the downloaded p8 file to firebase settings with noted key ID and the account team ID
134 |
135 | ## iOS setup
136 |
137 | - [Install homebrew](https://capacitorjs.com/docs/getting-started/environment-setup#homebrew) _(once)_
138 | - `brew install cocoapods` _(once a time)_
139 | - `ionic start my-cap-app --capacitor`
140 | - `cd my-cap-app`
141 | - `mkdir www && touch www/index.html`
142 | - `npx cap add ios`
143 | - `npm install --save @capacitor-community/fcm`
144 | - `npx cap sync ios` _(always do sync after a plugin install)_
145 | - `npx cap open ios`
146 |
147 | * sign your app at xcode (general tab)
148 | * enable remote notification capabilities
149 | * add `GoogleService-Info.plist` to the app folder in xcode
150 |
151 | ```
152 | // (optional) turn off `swizzling` in the `info.plist`
153 | FirebaseAppDelegateProxyEnabled
154 | NO
155 | ```
156 |
157 | > Tip: every time you change a native code you may need to clean up the cache (Product > Clean build folder) and then run the app again.
158 |
159 | ### Prevent auto initialization
160 |
161 | If you need to implement opt-in behavior, you can disable the auto initialization of the library by following the [Firebase docs](https://firebase.google.com/docs/cloud-messaging/ios/client#prevent_auto_initialization).
162 |
163 | ### SPM setup (iOS 15.0+)
164 |
165 | __First ensure all your dependencies are compatible with SPM. Otherwise, stick to the Cocoapods installation steps.__
166 |
167 | You can also install the plugin using Swift Package Manager (SPM) instead of CocoaPods.
168 | To do so, you don't need to install CocoaPods (steps 1 & 2), but you'll need to configure capacitor to use SPM:
169 | * to add iOS target: `npx cap add ios --packagemanager SPM`
170 | * to migrate an existing target: `npx cap spm-migration-assistant` (with capacitor 7.4.0+).
171 |
172 | You can find more info in the official [capacitor docs](https://capacitorjs.com/docs/ios/spm).
173 |
174 | ## Android setup
175 |
176 | - `ionic start my-cap-app --capacitor`
177 | - `cd my-cap-app`
178 | - `mkdir www && touch www/index.html`
179 | - `npx cap add android`
180 | - `npm install --save @capacitor-community/fcm`
181 | - `npx cap sync android` _(always do sync after a plugin install)_
182 | - `npx cap open android`
183 | - add `google-services.json` to your `android/app` folder
184 |
185 | Now you should be set to go. Try to run your client using `ionic cap run android --livereload`.
186 |
187 | > Tip: every time you change a native code you may need to clean up the cache (Build > Clean Project | Build > Rebuild Project) and then run the app again.
188 |
189 | ### Variables
190 |
191 | This plugin will use the following project variables (defined in your app's `variables.gradle` file):
192 |
193 | - `$firebaseMessagingVersion` version of `com.google.firebase:firebase-messaging` (default: `23.1.2`)
194 |
195 | ### Prevent auto initialization
196 |
197 | If you need to implement opt-in behavior, you can disable the auto initialization of the library by following the [Firebase docs](https://firebase.google.com/docs/cloud-messaging/android/client#prevent-auto-init).
198 |
199 | ## Example
200 |
201 | - https://github.com/capacitor-community/fcm/tree/master/example
202 |
203 | ## License
204 |
205 | MIT
206 |
207 | ## Contributors ✨
208 |
209 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
210 |
211 |
212 |
213 |
214 |
258 |
259 |
260 |
261 |
262 |
263 |
264 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
265 |
--------------------------------------------------------------------------------