@@ -37,13 +37,13 @@ public class IterableInAppManager {
37
37
* @param dialogOptions
38
38
* @param clickCallback
39
39
*/
40
- public static void showNotification (Context context , JSONObject dialogOptions , IterableNotificationData trackParams , IterableHelper .IterableActionHandler clickCallback ) {
40
+ public static void showNotification (Context context , JSONObject dialogOptions , String messageId , IterableHelper .IterableActionHandler clickCallback ) {
41
41
if (dialogOptions != null ) {
42
42
String type = dialogOptions .optString (IterableConstants .ITERABLE_IN_APP_TYPE );
43
43
if (type .equalsIgnoreCase (IterableConstants .ITERABLE_IN_APP_TYPE_FULL )) {
44
- showFullScreenDialog (context , dialogOptions , trackParams , clickCallback );
44
+ showFullScreenDialog (context , dialogOptions , messageId , clickCallback );
45
45
} else {
46
- showNotificationDialog (context , dialogOptions , trackParams , clickCallback );
46
+ showNotificationDialog (context , dialogOptions , messageId , clickCallback );
47
47
}
48
48
} else {
49
49
IterableLogger .d (TAG , "In-App notification not displayed: showNotification must contain valid dialogOptions" );
@@ -56,7 +56,7 @@ public static void showNotification(Context context, JSONObject dialogOptions, I
56
56
* @param dialogParameters
57
57
* @param clickCallback
58
58
*/
59
- static void showNotificationDialog (Context context , JSONObject dialogParameters , IterableNotificationData trackParams , IterableHelper .IterableActionHandler clickCallback ) {
59
+ static void showNotificationDialog (Context context , JSONObject dialogParameters , String messageId , IterableHelper .IterableActionHandler clickCallback ) {
60
60
Dialog dialog = new Dialog (context , android .R .style .Theme_Material_NoActionBar );
61
61
dialog .requestWindowFeature (Window .FEATURE_NO_TITLE );
62
62
dialog .setCanceledOnTouchOutside (true );
@@ -105,7 +105,7 @@ static void showNotificationDialog(Context context, JSONObject dialogParameters,
105
105
//Buttons
106
106
JSONArray buttonJson = dialogParameters .optJSONArray (IterableConstants .ITERABLE_IN_APP_BUTTONS );
107
107
if (buttonJson != null ) {
108
- verticalLayout .addView (createButtons (context , dialog , buttonJson , null , clickCallback ));
108
+ verticalLayout .addView (createButtons (context , dialog , buttonJson , messageId , clickCallback ));
109
109
}
110
110
111
111
dialog .setContentView (verticalLayout );
@@ -118,7 +118,7 @@ static void showNotificationDialog(Context context, JSONObject dialogParameters,
118
118
* @param dialogParameters
119
119
* @param clickCallback
120
120
*/
121
- static void showFullScreenDialog (Context context , JSONObject dialogParameters , IterableNotificationData trackParams , IterableHelper .IterableActionHandler clickCallback ) {
121
+ static void showFullScreenDialog (Context context , JSONObject dialogParameters , String messageId , IterableHelper .IterableActionHandler clickCallback ) {
122
122
Dialog dialog = new Dialog (context , android .R .style .Theme_Light );
123
123
dialog .requestWindowFeature (Window .FEATURE_NO_TITLE );
124
124
@@ -184,7 +184,7 @@ static void showFullScreenDialog(Context context, JSONObject dialogParameters, I
184
184
//Buttons
185
185
JSONArray buttonJson = dialogParameters .optJSONArray (IterableConstants .ITERABLE_IN_APP_BUTTONS );
186
186
if (buttonJson != null ) {
187
- View buttons = createButtons (context , dialog , buttonJson , trackParams , clickCallback );
187
+ View buttons = createButtons (context , dialog , buttonJson , messageId , clickCallback );
188
188
LinearLayout .LayoutParams buttonParams = new LinearLayout .LayoutParams (
189
189
LinearLayout .LayoutParams .MATCH_PARENT ,
190
190
LinearLayout .LayoutParams .WRAP_CONTENT );
@@ -223,11 +223,11 @@ public static JSONObject getNextMessageFromPayload(String payload) {
223
223
* @param context
224
224
* @param dialog
225
225
* @param buttons
226
- * @param trackParams
226
+ * @param messageId
227
227
* @param clickCallback
228
228
* @return
229
229
*/
230
- private static View createButtons (Context context , Dialog dialog , JSONArray buttons , IterableNotificationData trackParams , IterableHelper .IterableActionHandler clickCallback ) {
230
+ private static View createButtons (Context context , Dialog dialog , JSONArray buttons , String messageId , IterableHelper .IterableActionHandler clickCallback ) {
231
231
LinearLayout .LayoutParams equalParamWidth = new LinearLayout .LayoutParams (
232
232
LinearLayout .LayoutParams .MATCH_PARENT ,
233
233
LinearLayout .LayoutParams .MATCH_PARENT , 1.0f );
@@ -244,7 +244,7 @@ private static View createButtons(Context context, Dialog dialog, JSONArray butt
244
244
button .setBackgroundColor (getIntColorFromJson (buttonJson , IterableConstants .ITERABLE_IN_APP_BACKGROUND_COLOR , Color .LTGRAY ));
245
245
String action = buttonJson .optString (IterableConstants .ITERABLE_IN_APP_BUTTON_ACTION );
246
246
if (!action .isEmpty ()) {
247
- button .setOnClickListener (new IterableInAppActionListener (dialog , i , action , trackParams , clickCallback ));
247
+ button .setOnClickListener (new IterableInAppActionListener (dialog , i , action , messageId , clickCallback ));
248
248
}
249
249
250
250
JSONObject textJson = buttonJson .optJSONObject (IterableConstants .ITERABLE_IN_APP_CONTENT );
0 commit comments