質問編集履歴
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,13 +16,19 @@
|
|
16
16
|
|
17
17
|
Monaca側ではFCMのロジックはこれだけです。
|
18
18
|
|
19
|
+
プラグインのバグか何かでしょうか。
|
19
20
|
|
20
21
|
|
21
|
-
プラグインのバグか何かでしょうか。
|
22
22
|
|
23
|
-
|
23
|
+
10/6追記
|
24
24
|
|
25
|
+
titleは送る側のミスでした。
|
26
|
+
|
27
|
+
アイコンはまだ直ってません。。。
|
28
|
+
|
25
|
-
|
29
|
+
Android4.x 7.xではアプリ起動中でもアイコンが表示されていました。
|
30
|
+
|
31
|
+
```Js
|
26
32
|
|
27
33
|
|
28
34
|
|
@@ -74,6 +80,54 @@
|
|
74
80
|
|
75
81
|
```
|
76
82
|
|
83
|
+
プラグインのここらへんでアイコンの指定をしてそうなのですがMonacaのディレクトリのどこが対応しているかが分かりません。
|
84
|
+
|
85
|
+
ご存知の方ご教授願います。。
|
86
|
+
|
87
|
+
```Java
|
88
|
+
|
89
|
+
int resID = getResources().getIdentifier("notification_icon", "drawable", getPackageName());
|
90
|
+
|
91
|
+
if (resID != 0) {
|
92
|
+
|
93
|
+
notificationBuilder.setSmallIcon(resID);
|
94
|
+
|
95
|
+
} else {
|
96
|
+
|
97
|
+
notificationBuilder.setSmallIcon(getApplicationInfo().icon);
|
98
|
+
|
99
|
+
}
|
77
100
|
|
78
101
|
|
102
|
+
|
103
|
+
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M)
|
104
|
+
|
105
|
+
{
|
106
|
+
|
107
|
+
int accentID = getResources().getIdentifier("accent", "color", getPackageName());
|
108
|
+
|
109
|
+
notificationBuilder.setColor(getResources().getColor(accentID, null));
|
110
|
+
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
Notification notification = notificationBuilder.build();
|
116
|
+
|
117
|
+
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){
|
118
|
+
|
119
|
+
int iconID = android.R.id.icon;
|
120
|
+
|
121
|
+
int notiID = getResources().getIdentifier("notification_big", "drawable", getPackageName());
|
122
|
+
|
123
|
+
if (notification.contentView != null) {
|
124
|
+
|
125
|
+
notification.contentView.setImageViewResource(iconID, notiID);
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
}
|
130
|
+
|
131
|
+
```
|
132
|
+
|
79
133
|
![![プッシュのスクショ](88b3dc0a55df7278a8807284c4fcb422.png)]
|