ããã«ã¡ã¯ã
ããã·ã¥éç¥ãé
ä¿¡ããããšãã«Androidã¹ããŒã¿ã¹ããŒã«è¡šç€ºãããã¢ã€ã³ã³ãå€æŽããããšããŠããŸãã äœãèµ·ãã£ãŠãããã®äŸã次ã«ç€ºããŸãã
ã芧ã®ãšãããç§ã®ã¢ããªã®ã¢ã€ã³ã³ã¯éæãªç»åã§ã¯ãããŸããã éæãªç»åã«å€æŽãããšãããã·ã¥ã¢ã€ã³ã³ã¯æ£åžžã«èŠããŸãããã¢ããªã¢ã€ã³ã³ã¯éæãªç»åã«ãªããããã¯ç§ãæããã®ã§ã¯ãããŸããã ãã¡ã€ã«åã®ããŸããŸãªããªãšãŒã·ã§ã³ãè©ŠããŸããããäœãæ©èœããªãããã§ãã ã³ãŒãã調ã¹ããšã73è¡ç®ã®src / android /FirebasePluginMessagingService.javaã«æ¬¡ã®ããã«è¡šç€ºãããŸãã
.setSmallIcon(getApplicationInfo().icon)
ã¢ããªã®ã¢ã€ã³ã³ãšã¯å¥ã®ã¢ã€ã³ã³ãèšå®ããããšã¯ã§ããªããšèšã£ãŠããã®ã¯æ£ããã§ããïŒ
ã¹ããŒã¿ã¹ããŒã¢ã€ã³ã³ã«å¥ã®ãã¡ã€ã«ãèšå®ããããšã¯ã§ããŸããïŒ
ãŸãã¯ããã®åé¡ãåé¿ããæ¹æ³ã«é¢ããä»ã®ææ¡ã¯ãããŸããïŒ
ããã¯ãã¹ãããŠããŸããããå¿ èŠãªãã¹ãŠã®ãµã€ãºã§fcm_push_icon.pngãäœæããããšã§ãã«ã¹ã¿ã ã¢ã€ã³ã³ãèšå®ã§ããã¯ãã§ãã ããã©ã«ãã§ã¯ãfcm_push_icon.pngãååšããªãå Žåãã¢ããªã¢ã€ã³ã³ã䜿çšãããŸãã ã¢ã€ã³ã³ã¯android / resãã©ã«ããŒããªãŒã«ããã¯ãã§ãã
ããã䜿çšããŠãããŸããŸãªãµã€ãºããã¹ãŠçæã§ããŸãïŒhttpïŒ //romannurik.github.io/AndroidAssetStudio/icons-notification.html
ããã«ã¡ã¯ãç§ãã¡ã¯åãåé¡ã«çŽé¢ããŠããŸãã android / resãã©ã«ããŒããªãŒã«fcm_push_icon.png
ã¢ã€ã³ã³ãé
眮ããããšããŸããããéç¥ã¢ã€ã³ã³ã¯ãŸã çœã§ãã
@MikeBateman解決çãèŠã€ããŸãããïŒ
ããã«ã¡ã¯ããã®åé¡ãåé¿ããã«ã¯ãã¢ããªã®ã¿ãŒã²ããSDKãå€æŽã§ããŸããããã確èªããŠãã ããããã ãããã¡ãããããã¯é©åãªè§£æ±ºçã§ã¯ãããŸããã
ç§ã¯èª¿æ»ããŠããŠããã®è§£æ±ºçãåŸãŸããïŒ
ãã®ã«ãŒãsrc / android / FirebasePluginMessagingService.javaã«ç§»åãããã®è¡.setSmallIcon(getApplicationInfo().icon)
ïŒåè¿°ã®@MikeBatemanãªã©ïŒãèŠã€ããŠãã¢ããªãandroid lollipop +ã§å®è¡ãããŠãããã©ããã確èªããæ¡ä»¶ãè¿œå ããŸããããã§ãªãå Žåã¯ããããªã¢ã«ãã¶ã€ã³ã¢ã€ã³ã³ã䜿çšããå¿
èŠããããŸããããã©ã«ãã®ã¢ããªã®ã¢ã€ã³ã³ã§ããã³ãŒãã䜿çšããŸãã
...
.setSmallIcon(getNotificationIcon())
...
//At the end of FirebasePluginMessagingService.java
private int getNotificationIcon() {
boolean useWhiteIcon = (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP);
System.out.println("SCLMTEST >lollipop?:"+useWhiteIcon);
return useWhiteIcon ? R.drawable.myMaterialIcon: getApplicationInfo().icon;
}
ãããªã¢ã«ãã¶ã€ã³ã®ã¢ã€ã³ã³ãmyappresourcesã«é 眮ããã®ãæåã ãšæããŸãããã©ã°ã€ã³ã¯ããèªäœã§ãã®ä»äºãããŸãããä»ã¯ãã®æ¹æ³ãããããŸããã誰ãããããçŽ æŽããããã®ã«ã§ãããªããããã圹ç«ã€ããšãé¡ã£ãŠããŸãã @delphaber
33c52c7e8a1835d5f595e58eaef43e4f49b4b23aã§ä¿®æ£æžã¿
ãã©ã°ã€ã³ã¯ãdrawableã«notification_iconãååšããå Žåãããã䜿çšããããã«ãªããŸããã ãã以å€ã®å Žåã¯ãããã©ã«ãã®ã¢ããªã¢ã€ã³ã³ã䜿çšããŸã
ããã
ããããŸããã åæç»å¯èœãã©ã«ããŒïŒãµã€ãºããšïŒã«notification_icon.png
ãé
眮ããããšããŸãããããã©ã°ã€ã³ã¯åŒãç¶ãããã©ã«ãã®ãã©ã«ããŒïŒã¢ããªã¢ã€ã³ã³ïŒã䜿çšããŸãã ç§ã¯äœããéããŸãããïŒ
ããããšãïŒ
@blckshrk cc / @robertarnesson
Android srcãã¡ã€ã«ãæŽæ°ãããã¹ãŠã®notification_icon.png
ãã¡ã€ã«ãè¿œå ããåŸããåãåé¡ãçºçããŸããããŸã çœãåè§ã衚瀺ãããŠããŸããã ç§ã¯ããããã®ã¢ããã€ã¹ã«åŸãããšã«ãªããŸããïŒ http ïŒ//stackoverflow.com/questions/37325051/notification-icon-with-the-new-firebase-cloud-messaging-system
ãŸããGoogleãªããžããªãæŽæ°ããŠãææ°ã®FirebaseSDKãã³ã³ãã¥ãŒã¿ãŒäžã§ææ°ã®ãã®ã«ããå¿
èŠããããŸããã ããã¯ããããæžããŠããæç¹ã§ã®com.google.firebase:firebase-core
ã®ããŒãžã§ã³9.8.0ã§ãããç§ã¯ãããæ©èœãããŠããŸãã ïŒä»¥åã¯9.4.0ã§ããïŒ
次ã«ããããAndroidManifest.xml
ã«è¿œå ããŸããïŒ
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
ãããã®ãªãã·ã§ã³ã䜿çšããŠdefault_notification_color
ãå€æŽããå Žåã¯ã以äžãè¿œå ããå¿
èŠããããŸãã ç§ãã¡ã®ã¢ã€ã³ã³ã¯èæ¯ãéæãªçœãã¢ã€ã³ã³ãªã®ã§ãåŸãã«ç¬èªã®è²ãè¿œå ããŸãããããã¯ããã¯ç»é¢ã«é©ããŠããŸãã
<meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/orange" />
ãŸãã次ã®res/values/colors.xml
ãã¡ã€ã«ãè¿œå ããå¿
èŠããããŸããããã¯ãèæ¯ãèšå®ããå Žåã¯ãã¡ãããç¬èªã®è²ãéžæã§ããŸãã
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="orange">#FF8614</color>
</resources>
ããã¯ãã¹ãŠFirebase9.8.0以éã§æ©èœããŸã
@blckshrkãããžã§ã¯ãã«ã¢ã€ã³ã³ãè¿œå ããã«ã¯ã©ãããã°ããã§ããïŒ ãããžã§ã¯ãã®config.xmlã䜿çšããŠããããããªãœãŒã¹ã«è¿œå ããå¿ èŠããããŸãã ç§ãç¥ãéãããããããã©ã«ããŒã«å ¥ããã ãã§ã¯ãã³ãŒãã«è¡šç€ºãããŸããã
çŸåšãIonic 2ã䜿çšããŠã¢ããªãäœæãã次ã®ããšãè¡ã£ãŠããŸãã
ionicã®resãã©ã«ããŒã«ã¢ã€ã³ã³ãã¡ã€ã«ãè¿œå ããã®ã§ãã³ãã³ãionic resources
ãå®è¡ãããšãããŸããŸãªç»é¢ãµã€ãºã®ç»åãäœæãããŸãã
ããã«ããã config.xml
ãã¡ã€ã«ã«ç»åãã¹ãè¿œå ãããŸãã
æ£ç¢ºã«äœãããå¿ èŠããããã«ã€ããŠã誰ãã詳现ãªè¿ä¿¡ãããŠãããŸãããã
ãã€ãã£ãAndroidã®ã³ãŒããšãã©ã«ããŒæ§é ã«ã€ããŠã®ç¥èããªãã®ã§ãããã«å¿ããŠè¿ä¿¡ããŠãã ããã
-ããããšã
å®ã¯@prantikvã®ããã«ãç§ã¯å°ãè¿·ã£ãŠããŸãã ç§ã¯Ionic1ã䜿çšããŠããŸãïŒãã ããåãã¯ãŒã¯ãããŒã䜿çšããŠããŸãïŒã ã¢ã€ã³ã³ãres/drawable/
ã«é
眮ãã cordova-custom-configã䜿çšããŠAndroidManifest.xml
ïŒ manifest
ããŒãã«çŽæ¥ïŒã«<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
ãè¿œå ããããšããŸããããæåŸ
ã©ããã«æ©èœãããã®ã¯ãããŸããã
@gylippus com.google.firebase:firebase-core
ã®éšåãããããŸããã ããŒãžã§ã³ãã©ã®ããã«ç¢ºèªããŸããïŒ
ã¿ããªããããšãïŒ
@robertarnesson @gylippuså®çšçãªäŸã¯ãããŸããïŒ
ç§ã¯ãããcordova-custom-configã§åäœãããããšãã§ããŸãã
<config-file parent="./application" target="AndroidManifest.xml">
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
</config-file>
ãšplatforms/android/res/drawable/notification_icon.png
ããªãã®å©ããã©ããããããšãïŒ
notification_icon.png
ãã«ãŒãïŒãŸãã¯resources
ïŒãã©ã«ããŒã«ããå ŽåïŒãã¡ã€ã«ã®ç§»åãšãããã§ã¹ãã®ç·šéïŒããã®ãžã§ããèªåçã«å®è¡ããïŒãã¡ã€ã«ã移åããŠãããã§ã¹ããç·šéããïŒããã®ããã¯ããããšäŸ¿å©ã§ãïŒæ§æãã¡ã€ã«ïŒã ããã«ã€ããŠã©ãæããŸãããïŒ
@blckshrk
ãã£ãããããã«æ¬¡ã®ã³ãŒããè¿œå ããŠã¿ãŸãã
<config-file parent="./application" target="AndroidManifest.xml">
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
</config-file>
ãããããã«ãããã»ã¹äžã«æ¬¡ã®ãšã©ãŒãçºçããŸã
:processDebugResources
E:\Development\IONIC 2\allcouriertracking\allcouriertracking5\platforms\android\res\xml\config.xml:57 : AAPT: Error parsing XML: unbound prefix
FAILED
FAILURE: Build failed with an exception.
:processDebugResources
E:\Development\IONIC 2\allcouriertracking\allcouriertracking5\platforms\android\res\xml\config.xml:57 : AAPT: Error parsing XML: unbound prefix
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'I:\DEVELOPMENT PROGRAMS\android-sdk-windows\build-tools\24.0.3\aapt.exe'' finished with non-zero exit value 1
次ã«ãAndroidManifest.xmlã«ä»¥äžãæåã§è¿œå ããŸãã<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
ãŸããAndroid 4.4ã§ã¯æ©èœããŸããããAndroid5.1ã§ã¯æ©èœããŸããã
ã©ã®ããŒãžã§ã³çšã«ãã«ãããŸãããïŒ
ãŸãã notification_icon.png
ãã¡ã€ã«ããã¹ãŠã®drawable
ãã©ã«ããŒã«è¿œå ããŸãããããããšã1ã€ã ãè¿œå ããŸãããïŒ
@prantikv https://github.com/dpa99c/cordova-custom-configãã€ã³ã¹ããŒã«ããŸãããïŒ
å®éãç§ã¯ãã®ããã¯https://github.com/driftyco/ionic-package-hooks/blob/master/android_custom_resources.jsã䜿çšããŠã notification_icon.png
ãã¡ã€ã«ãåæç»å¯èœãã©ã«ããŒã«èªåçã«ç§»åããŸãã
åºæ¬çã«ç§ã¯ããã<platform name="android">
ããŒãå
ã«æã£ãŠããŸãïŒ
<hook src="hooks/after_prepare/android_custom_resources.js" type="after_prepare"/>
<config-file parent="./application" target="AndroidManifest.xml">
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
</config-file>
ãŸãããã®ããã¯https://github.com/driftyco/ionic-package-hooks/blob/master/android_custom_values.jsãš@gylippusã«ãã£ãŠææ¡ããããœãªã¥ãŒã·ã§ã³ã䜿çšããŠè²ãåŠçããããšãã§ããŸããïŒããããšãïŒïŒ
@blckshrkã¯ãããã©ã°ã€ã³ãã€ã³ã¹ããŒã«ããŸããã䜿çšããŠããç»åã®ãµã€ãºãæããŠãã ãããç»åã®ãµã€ãºãšKBåäœã®ãµã€ãºãæããŠãã ããã
ãããŠãããªããããããã¹ããããã©ãããã©ãŒã ã
ããã«é¢ããæŽæ°ã¯ãããŸããïŒ ä»ãã20æ¥çµã£ãŠã解決çã¯ãããŸãããïŒ ããã§ãåé¡ãããå Žåã¯éããããšãã§ããŸãããïŒïŒ
åãåé¡ãããããµãŒããŒåŽãã解決ã§ããŸããã ç§ã¯æåã§ã¢ã€ã³ã³ãplatform-androidãã©ã«ããŒå
ã®notification_icon.pngãšããååã®æç»å¯èœãªãã©ã«ããŒã«é
眮ããŸããã
Firebaseã³ã³ãœãŒã«ããééã£ãã¢ã€ã³ã³ã衚瀺ããç¶ããŸãããç¬èªã®ãµãŒããŒãããªã¯ãšã¹ãã®æ¬æãšããŠæ¬¡ã®ã¡ãã»ãŒãžãéä¿¡ããŸãã
$fields = array(
"registration_ids" => "array of registration ids",
"notification" => array(
"body"=>"message to send as a body",
"icon"=>"notification_icon",
"color"=>"your color in hex"
),
"priority"=>10
);
ãã®å©ããé¡ã£ãŠããŸã
å®éããã°ãèšé²ããŠèªã¿åã£ãåŸãFirebasePluginMessagingService.java / sendNotificationã®notificationBuilderã³ãŒãå šäœã¯ãéç¥ãã€ããŒããããå Žåã¯å®è¡ãããªããããæå³ããªãããã«èŠããŸãã ã¢ã€ã³ã³ã®åé¡ã¯å¥ãšããŠãnotificationBuilderã³ãŒãã.setSoundïŒdefaultSoundUriïŒãå®è¡ããããããããçãããã«ãªããŸããããéç¥ããã¬ã€ã«å°çãããšãã«åçãããããšã¯ãããŸããã
éç¥ã¯ãã©ã°ã€ã³ã³ãŒãã§ã¯ãªããéç¥ãã€ããŒãããåœä»€ãåãåãFCMèªäœã«ãã£ãŠäœæããããããäžèšã®sergiojupã®ãœãªã¥ãŒã·ã§ã³ãæ©èœããã®ã¯ãã®ããã§ãã
çç±ã«ã€ããŠã¯ãAndroidã§ã¯ãonMessageReceivedã¯æ¬¡ã®å Žåã«ã®ã¿åŒã³åºãããŸãã
*ïŒéç¥ãã€ããŒãã®ã¿ããããã¢ããªã¯ãã©ã¢ã°ã©ãŠã³ãã«ãããŸã
*ïŒéç¥ãã€ããŒããšããŒã¿ãã€ããŒãããããã¢ããªã¯ãã©ã¢ã°ã©ãŠã³ãã«ãããŸã
*ïŒããŒã¿ãã€ããŒãã®ã¿ããããã¢ããªã¯ãã©ã¢ã°ã©ãŠã³ããŸãã¯ããã¯ã°ã©ãŠã³ãã«ãããŸã
ãããã£ãŠããããã®å ŽåãonMessageReceivedã¯åŒã³åºãããŸããã
*ïŒéç¥ãã€ããŒãã®ã¿ããããã¢ããªã¯ããã¯ã°ã©ãŠã³ãã«ãããŸã
*ïŒéç¥ãã€ããŒããšããŒã¿ãã€ããŒãããããã¢ããªã¯ããã¯ã°ã©ãŠã³ãã«ãããŸã
ã³ãŒããèŠããšããã©ã°ã€ã³ã«éç¥ããã«ããããå¯äžã®æ¹æ³ã¯ãã¢ããªãããã¯ã°ã©ãŠã³ãã«ãããšãã«ãã¿ã€ãã«ãšããã¹ãã®äž¡æ¹ã®ããããã£ãæã€ããŒã¿ãã€ããŒãã®ã¿ã䜿çšããããšã§ãã
ããããšã@blckshrk !! ç§ã¯ã€ãã«ããããã£ãŠæ©èœãããŸããïŒ
ç§ã¯Ionicv2ãš[email protected]ã䜿çšããŠããŸãïŒ
ã€ãªã³ïŒ2.2.2
ã³ã«ããïŒ6.5.0
npmïŒ4.6.1
custom-configãã©ã°ã€ã³ãã€ã³ã¹ããŒã«ããŸãã
$ ionic plugin add cordova-custom-config --fetch --save
https://github.com/driftyco/ionic-package-hooks/blob/master/android_custom_resources.jsãšhttps://github.com/driftyco/ionic-package-hooks/blob/master/android_custom_values.jsãã«ããŠã³ããŒãããŸããããžã§ã¯ãã«ãŒãã®ãpackage-hooksãïŒãŸãã¯å¿
èŠãªãã®ïŒãšåŒã°ããæ°ãããã£ã¬ã¯ããªã
package-hooks/android_custom_resources.js
package-hooks/android_custom_values.js
ãããžã§ã¯ãã«ãŒãïŒãã©ãããã©ãŒã å
ã§ã¯ãªãïŒã«æ¬¡ã®ãã£ã¬ã¯ããªãšãã¡ã€ã«ãäœæããŸãã
resources/android/custom/notification_icon.png
resources/android/values/styles.xml
notification_icon.png
ã¯Android> = API21éç¥ã¢ã€ã³ã³ã§ãã é±å±±ã¯144x144pxã§ãèŠæ ããããŸãã
styles.xml
ã«å«ãŸãããã®ïŒ
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red">#FF8614</color>
</resources>
<widget ... xmlns:android="http://schemas.android.com/apk/res/android">
<platform name="android">
<hook src="package-hooks/android_custom_resources.js" type="after_prepare"/>
<hook src="package-hooks/android_custom_values.js" type="after_prepare"/>
<config-file parent="./application" target="AndroidManifest.xml">
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon"/>
<meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/red"/>
</config-file>
</platform>
<widget>
ãããŠããããã¹ãŠã§ãïŒ
config.xmlã®ã©ãã«ä»¥äžãè¿œå ããã®ãããããŸãããïŒ ãã®ããã®ãã³ãïŒ ãŸããç§ã¯XMLã«ããŸã詳ãããããŸããããåå空éã«æ£ç¢ºã«äœãè¿œå ããå¿ èŠããããŸããïŒ @shamank
<widget ... xmlns:android="http://schemas.android.com/apk/res/android">
<platform name="android">
<hook src="package-hooks/android_custom_resources.js" type="after_prepare"/>
<hook src="package-hooks/android_custom_values.js" type="after_prepare"/>
<hook src="package-hooks/android_fixes.js" type="after_prepare"/>
<config-file parent="./application" target="AndroidManifest.xml">
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon"/>
<meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/red"/>
</config-file>
</platform>
<widget>
@Rockforcedç³ãèš³ãããŸããããç§ã¯æè¿ã¯è¡ã£ãŠããŸããã å ã®ãã¡ã€ã«ãèŠãŠãã ããïŒãã¡ãããããã€ãã眮ãæããããŠããŸãïŒã ããã圹ã«ç«ãŠã°å¹žãã
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.example" version="1.0.20" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>Test</name>
<description>Blabla.</description>
<author email="[email protected]" href="https://example.com/">Example</author>
<content src="index.html"/>
<access origin="*"/>
<allow-navigation href="http://ionic.local/*"/>
<allow-navigation href="http://192.168.0.1:8100"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<allow-intent href="market:*"/>
<hook src="package-hooks/android_custom_resources.js" type="after_prepare"/>
<hook src="package-hooks/android_custom_values.js" type="after_prepare"/>
<hook src="package-hooks/android_fixes.js" type="after_prepare"/>
<config-file parent="./application" target="AndroidManifest.xml">
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon"/>
<meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/red"/>
</config-file>
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png"/>
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png"/>
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png"/>
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png"/>
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png"/>
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png"/>
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png"/>
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png"/>
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png"/>
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png"/>
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png"/>
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png"/>
</platform>
<platform name="ios">
<allow-intent href="itms:*"/>
<allow-intent href="itms-apps:*"/>
<icon height="57" src="resources/ios/icon/icon.png" width="57"/>
<icon height="114" src="resources/ios/icon/[email protected]" width="114"/>
<icon height="40" src="resources/ios/icon/icon-40.png" width="40"/>
<icon height="80" src="resources/ios/icon/[email protected]" width="80"/>
<icon height="120" src="resources/ios/icon/[email protected]" width="120"/>
<icon height="50" src="resources/ios/icon/icon-50.png" width="50"/>
<icon height="100" src="resources/ios/icon/[email protected]" width="100"/>
<icon height="60" src="resources/ios/icon/icon-60.png" width="60"/>
<icon height="120" src="resources/ios/icon/[email protected]" width="120"/>
<icon height="180" src="resources/ios/icon/[email protected]" width="180"/>
<icon height="72" src="resources/ios/icon/icon-72.png" width="72"/>
<icon height="144" src="resources/ios/icon/[email protected]" width="144"/>
<icon height="76" src="resources/ios/icon/icon-76.png" width="76"/>
<icon height="152" src="resources/ios/icon/[email protected]" width="152"/>
<icon height="167" src="resources/ios/icon/[email protected]" width="167"/>
<icon height="29" src="resources/ios/icon/icon-small.png" width="29"/>
<icon height="58" src="resources/ios/icon/[email protected]" width="58"/>
<icon height="87" src="resources/ios/icon/[email protected]" width="87"/>
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640"/>
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750"/>
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242"/>
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536"/>
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768"/>
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640"/>
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320"/>
</platform>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="android-targetSdkVersion" value="23"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashMaintainAspectRatio" value="true"/>
<preference name="SplashReloadOnOrientationChange" value="true"/>
<preference name="SplashScreenDelay" value="3000"/>
<preference name="FadeSplashScreen" value="false"/>
<preference name="FadeSplashScreenDuration" value="0"/>
<preference name="orientation" value="portrait"/>
<preference name="SplashScreenBackgroundColor" value="0xFFFFFFFF"/>
<preference name="SplashScreen" value="screen"/>
<preference name="AutoHideSplashScreen" value="false"/>
<preference name="KeyboardDisplayRequiresUserAction" value="false"/>
<preference name="loadUrlTimeoutValue" value="700000"/>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser"/>
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
</feature>
<plugin name="cordova-plugin-app-event" spec="~1.2.0"/>
<plugin name="cordova-plugin-device" spec="~1.1.3"/>
<plugin name="cordova-plugin-console" spec="~1.0.4"/>
<plugin name="cordova-plugin-whitelist" spec="~1.3.2"/>
<plugin name="cordova-plugin-splashscreen" spec="~4.0.2"/>
<plugin name="cordova-plugin-statusbar" spec="~2.2.2"/>
<plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
<plugin name="cordova-plugin-geolocation" spec="~2.4.1"/>
<plugin name="cordova-plugin-compat" spec="~1.1.0"/>
<plugin name="cordova-plugin-inappbrowser" spec="~1.6.1"/>
<plugin name="cordova-plugin-nativestorage" spec="~2.2.2"/>
<plugin name="cordova-plugin-firebase" spec="~0.1.20"/>
<plugin name="cordova.plugins.diagnostic" spec="~3.0.4"/>
<plugin name="cordova-plugin-googlemaps" spec="~1.4.0">
<variable name="API_KEY_FOR_ANDROID" value="blabla"/>
<variable name="API_KEY_FOR_IOS" value="blabla"/>
</plugin>
<plugin name="ionic-plugin-deeplinks" spec="~1.0.14">
<variable name="URL_SCHEME" value="blabla"/>
<variable name="DEEPLINK_SCHEME" value="https"/>
<variable name="DEEPLINK_HOST" value="www.blabla.com"/>
<variable name="ANDROID_PATH_PREFIX" value="/"/>
</plugin>
<plugin name="cordova-custom-config" spec="~3.2.0"/>
<icon src="resources/ios/icon/[email protected]"/>
<engine name="android" spec="~6.2.2"/>
</widget>
@shamankããããšãããããŸããã ããŒãžã§ã³0.1.24ãšäžæ¥äžæŠã£ãŠããŸããããéããªãããœãªã¥ãŒã·ã§ã³ã¯æ©èœããŠããŸããã ãããã«ã¹ã¿ã ã¢ã€ã³ã³ãæ©èœãããçç±ãæããŠããã ããŸããïŒ ç§ã¯ãç§ãèªãã§ãã®æ瀺ã«éåžžã«å³å¯ã«åŸããŸããããç°è²ã®ã¢ã€ã³ã³ãã衚瀺ãããŸããã§ããã ããªãã®è§£æ±ºçã¯ããã«æ©èœããŸãã...çç±ãç¥ãããã ãã§ãïŒ
@ jskidd3ã圹ã«ç«ãŠãŠããããã§ãïŒ ããã¯æ¬åœã«ç°¡åã§ãã cordova-custom-configãã©ã°ã€ã³ã䜿çšãããšããã©ãããã©ãŒã ããšã«Cordovaã®æçµæ§æãå€æŽã§ããŸãïŒInfo.plist / AndroidManifest.xmlïŒã ãããã£ãŠãconfig-fileãããã¯ã§ããã©ã°ã€ã³ã®Androidçšconfigã«ãdrawablesãã£ã¬ã¯ããªã§ãnotification_iconããšããæ°ããååã§ãdefault_notification_iconããæ€çŽ¢ããããã«æ瀺ããŸãïŒããèŠããŠããå Žåã¯ããã©ã°ã€ã³ããã¡ã€ã«æ¡åŒµåãåŠçããŸãïŒã 次ã«ã次ã®ãããã¯ïŒèµ€ïŒã§èæ¯è²ãå®çŸ©ããŸãã ããã§ããã«ãæã«ãã®ãã¡ã€ã«ïŒnotification_icon.pngïŒãé©åãªå Žæã«é 眮ããæ¹æ³ãå¿ èŠãªã®ã§ããããè¡ãã«ã¯ããã¯ãå¿ èŠã§ãã ããã¯android_custom_resources.jsã§ãã ããã¯ãresources / android / custom / *ã«ãããã®ããã¹ãŠååŸãããã«ãã®ãããŒã¢ãã«ãã£ã¬ã¯ããªã«é 眮ããŸãïŒã¹ã¯ãªãããç·šéããããšã§ãããå€æŽã§ããŸããããã®ã¿ã¹ã¯ã¯åé¡ãããŸããïŒã è¿œå ã®èšå®ã¹ã¿ã€ã«ãšåæ§ã§ãã ãã®styles.xmlãã¡ã€ã«ãäœæããŸãã è²ãå®çŸ©ãïŒç§ã¯ãèµ€ããšåä»ããŸãããã奜ããªããã«ååãä»ããããšãã§ããŸãïŒãandroid_custom_values.jsã¯ããããã«ãããããã£ã¬ã¯ããªãplatforms / android / res / valuesãã«ã³ããŒããŸãã æåŸã«ãconfig.xmlã§ããããã®ã¹ã¯ãªããããã€ã³ãããŠç¹å®ã®ç¬éã«å®è¡ããŸãã ãã®ã¿ã¹ã¯ã§ã¯ããafter_prepareããã³ããŒããå¿ èŠããããŸããã€ãŸããCordovaããã«ããæºåããåŸã§ãïŒããã§ããããèŠããŠããå Žåã¯ãIonicã®ããã±ãŒãžããã¯ã®ããã¥ã¡ã³ãã§è©³çŽ°/ã€ãã³ãã確èªã§ããŸãïŒã
@alexbonhommeã®çãã¯ç§ã®ããã«åããïŒïŒ https://github.com/arnesson/cordova-plugin-firebase/issues/53#issuecomment -304573222
@shamankã®æ±ºå®ã¯éšåçã«ç§ã®ããã«åããŸãã
Angular + Cordovaã䜿çšããŠããŸãã
android_custom_resources.jsã¯ãã©ã«ããŒïŒdrawable-ldpiãdrawable-mdpiãªã©ïŒãäœæããããã©ã«ããŒãååšããªãå Žåã¯ãã¡ã€ã«ãã³ããŒããŸããã
ãã®ããããã®ã¹ã¯ãªãããåé€ããŠconfig.xmlã§äœ¿çšããŸããã
泚ïŒã«ã¹ã¿ã ã®å€æŽã[email protected]ã«ãããã¹ãç°ãªãå Žåãããã>ã«ã¯å¥ã®å Žæã«res/
ãã©ã«ããŒããããŸãã
`
<resource-file src="res/custom/android/notification.png" target="app/src/main/res/drawable-mdpi/notification.png" />
<resource-file src="res/custom/android/notification.png" target="app/src/main/res/drawable-hdpi/notification.png" />
<resource-file src="res/custom/android/notification.png" target="app/src/main/res/drawable-xhdpi/notification.png" />
<resource-file src="res/custom/android/notification.png" target="app/src/main/res/drawable-xxhdpi/notification.png" />
<resource-file src="res/custom/android/notification.png" target="app/src/main/res/drawable-xxxhdpi/notification.png" />`
ãšã«ããã @ alexbonhommeãš@shamankã«æè¬ããŸãïŒ
@shamankã®ãœãªã¥ãŒã·ã§ã³ãã¹å
ã®Ionic3ïŒããå
·äœçã«ã¯cordova-android @ 7ïŒã®å ŽåïŒ
package-hooks/android_custom_resources.js
package-hooks/android_custom_values.js
res
ãã©ã«ããplatforms/android/app/src/main/
å
ã«ãããããæŽæ°ãããŸãã
package-hooks/android_custom_resources.js
ããŠæŽæ°ããŸã
var platformDir = 'platforms/android';
ã«
var platformDir = 'platforms/android/app/src/main';
package-hooks/android_custom_values.js
ããŠæŽæ°ããŸã
var platformDir = platforms/android/res/values';
ã«
var platformDir = 'platforms/android/app/src/main/res/values';
æãåèã«ãªãã³ã¡ã³ã
ããããšã@blckshrk !! ç§ã¯ã€ãã«ããããã£ãŠæ©èœãããŸããïŒ
ç§ã¯Ionicv2ãš[email protected]ã䜿çšããŠããŸãïŒ
ã€ãªã³ïŒ2.2.2
ã³ã«ããïŒ6.5.0
npmïŒ4.6.1
custom-configãã©ã°ã€ã³ãã€ã³ã¹ããŒã«ããŸãã
$ ionic plugin add cordova-custom-config --fetch --save
https://github.com/driftyco/ionic-package-hooks/blob/master/android_custom_resources.jsãšhttps://github.com/driftyco/ionic-package-hooks/blob/master/android_custom_values.jsãã«ããŠã³ããŒãããŸããããžã§ã¯ãã«ãŒãã®ãpackage-hooksãïŒãŸãã¯å¿ èŠãªãã®ïŒãšåŒã°ããæ°ãããã£ã¬ã¯ããªã
package-hooks/android_custom_resources.js
package-hooks/android_custom_values.js
ãããžã§ã¯ãã«ãŒãïŒãã©ãããã©ãŒã å ã§ã¯ãªãïŒã«æ¬¡ã®ãã£ã¬ã¯ããªãšãã¡ã€ã«ãäœæããŸãã
resources/android/custom/notification_icon.png
resources/android/values/styles.xml
notification_icon.png
ã¯Android> = API21éç¥ã¢ã€ã³ã³ã§ãã é±å±±ã¯144x144pxã§ãèŠæ ããããŸããstyles.xml
ã«å«ãŸãããã®ïŒãããŠããããã¹ãŠã§ãïŒ