|
35 | 35 | import com.iterable.iterableapi.IterableInAppLocation; |
36 | 36 | import com.iterable.iterableapi.IterableInAppManager; |
37 | 37 | import com.iterable.iterableapi.IterableInAppMessage; |
| 38 | +import com.iterable.iterableapi.IterableEmbeddedPlacement; |
38 | 39 | import com.iterable.iterableapi.IterableInboxSession; |
39 | 40 | import com.iterable.iterableapi.IterableLogger; |
40 | 41 | import com.iterable.iterableapi.IterableUrlHandler; |
@@ -490,28 +491,28 @@ public void getEmbeddedPlacements(Promise promise) { |
490 | 491 | IterableLogger.d(TAG, "getEmbeddedPlacements"); |
491 | 492 |
|
492 | 493 | // Create test data |
493 | | - JSONArray testPlacements = new JSONArray(); |
| 494 | + // JSONArray testPlacements = new JSONArray(); |
494 | 495 | try { |
495 | | - // Test placement 1 |
496 | | - JSONObject placement1 = new JSONObject(); |
497 | | - placement1.put("placementId", 808); |
498 | | - testPlacements.put(placement1); |
| 496 | + // // Test placement 1 |
| 497 | + // JSONObject placement1 = new JSONObject(); |
| 498 | + // placement1.put("placementId", 808); |
| 499 | + // testPlacements.put(placement1); |
499 | 500 |
|
500 | | - // Test placement 2 |
501 | | - JSONObject placement2 = new JSONObject(); |
502 | | - placement2.put("placementId", 1121); |
503 | | - testPlacements.put(placement2); |
504 | | - |
505 | | - // Test placement 2 |
506 | | - JSONObject placement3 = new JSONObject(); |
507 | | - placement3.put("placementId", 112); |
508 | | - testPlacements.put(placement3); |
509 | | - |
510 | | - |
511 | | - promise.resolve(Serialization.convertJsonToArray(testPlacements)); |
| 501 | + // // Test placement 2 |
| 502 | + // JSONObject placement2 = new JSONObject(); |
| 503 | + // placement2.put("placementId", 1121); |
| 504 | + // testPlacements.put(placement2); |
| 505 | + |
| 506 | + // // Test placement 2 |
| 507 | + // JSONObject placement3 = new JSONObject(); |
| 508 | + // placement3.put("placementId", 112); |
| 509 | + // testPlacements.put(placement3); |
| 510 | + |
| 511 | + JSONArray embeddedPlacementsJsonArray = Serialization.serializeEmbeddedMessages(IterableApi.getInstance().getEmbeddedManager().getMessages(1551)); |
| 512 | + promise.resolve(Serialization.convertJsonToArray(embeddedPlacementsJsonArray)); |
512 | 513 | } catch (JSONException e) { |
513 | | - |
514 | | - promise.reject("", "Failed to create test placements"); |
| 514 | + IterableLogger.e(TAG, e.getLocalizedMessage()); |
| 515 | + promise.reject("", "Failed to create test placements: " + e.getLocalizedMessage()); |
515 | 516 | } |
516 | 517 | } |
517 | 518 |
|
|
0 commit comments