|
6 | 6 | import android.content.Context; |
7 | 7 | import android.content.Intent; |
8 | 8 | import android.content.SharedPreferences; |
9 | | -import android.graphics.Typeface; |
10 | 9 | import android.location.Location; |
11 | 10 | import android.location.LocationManager; |
12 | 11 | import android.net.Uri; |
|
52 | 51 | import com.mparticle.media.MediaCallbacks; |
53 | 52 | import com.mparticle.messaging.MPMessagingAPI; |
54 | 53 | import com.mparticle.messaging.ProviderCloudMessage; |
55 | | -import com.mparticle.rokt.RoktConfig; |
56 | | -import com.mparticle.rokt.RoktEmbeddedView; |
57 | 54 |
|
58 | 55 | import org.jetbrains.annotations.NotNull; |
59 | 56 | import org.json.JSONObject; |
60 | 57 |
|
61 | 58 | import java.io.File; |
62 | | -import java.lang.ref.WeakReference; |
63 | 59 | import java.math.BigDecimal; |
64 | 60 | import java.util.HashMap; |
65 | 61 | import java.util.HashSet; |
@@ -114,7 +110,7 @@ public class MParticle { |
114 | 110 | protected boolean locationTrackingEnabled = false; |
115 | 111 | @NonNull |
116 | 112 | protected Internal mInternal = new Internal(); |
117 | | - protected Rokt rokt = new Rokt(); |
| 113 | + protected Rokt rokt; |
118 | 114 | private IdentityStateListener mDeferredModifyPushRegistrationListener; |
119 | 115 | @NonNull |
120 | 116 | private WrapperSdkVersion wrapperSdkVersion = new WrapperSdkVersion(WrapperSdk.WrapperNone, null); |
@@ -194,6 +190,7 @@ private static MParticle getInstance(@NonNull Context context, @NonNull MParticl |
194 | 190 | instance = new MParticle(options); |
195 | 191 | instance.mKitManager = new KitFrameworkWrapper(options.getContext(), instance.mMessageManager, instance.Internal().getConfigManager(), instance.Internal().getAppStateManager(), options); |
196 | 192 | instance.mIdentityApi = new IdentityApi(options.getContext(), instance.mInternal.getAppStateManager(), instance.mMessageManager, instance.mConfigManager, instance.mKitManager, options.getOperatingSystem()); |
| 193 | + instance.rokt = new Rokt(instance.mConfigManager, instance.mKitManager); |
197 | 194 |
|
198 | 195 | // Check if we've switched workspaces on startup |
199 | 196 | UploadSettings lastUploadSettings = instance.mConfigManager.getLastUploadSettings(); |
@@ -1788,136 +1785,6 @@ public interface ResetListener { |
1788 | 1785 | void onReset(); |
1789 | 1786 | } |
1790 | 1787 |
|
1791 | | - /** |
1792 | | - * ### Optional callback events for when the view loads and unloads. |
1793 | | - */ |
1794 | | - public interface MpRoktEventCallback { |
1795 | | - /** |
1796 | | - * onLoad Callback will be triggered immediately when the View displays. |
1797 | | - */ |
1798 | | - void onLoad(); |
1799 | | - |
1800 | | - /** |
1801 | | - * onUnLoad Callback will be triggered if the View failed to show or it closed. |
1802 | | - */ |
1803 | | - void onUnload(UnloadReasons reason); |
1804 | | - |
1805 | | - /** |
1806 | | - * onShouldShowLoadingIndicator callback will be triggered if View start processing |
1807 | | - */ |
1808 | | - void onShouldShowLoadingIndicator(); |
1809 | | - |
1810 | | - /** |
1811 | | - * onShouldHideLoadingIndicator callback will be triggered if View end processing |
1812 | | - */ |
1813 | | - void onShouldHideLoadingIndicator(); |
1814 | | - } |
1815 | | - |
1816 | | - /** |
1817 | | - * Enum representing the reasons for unloading. |
1818 | | - */ |
1819 | | - public enum UnloadReasons { |
1820 | | - /** |
1821 | | - * Called when there are no offers to display so the view does not get loaded in. |
1822 | | - */ |
1823 | | - NO_OFFERS, |
1824 | | - |
1825 | | - /** |
1826 | | - * View has been rendered and has been completed. |
1827 | | - */ |
1828 | | - FINISHED, |
1829 | | - |
1830 | | - /** |
1831 | | - * Operation to fetch view took too long to resolve. |
1832 | | - */ |
1833 | | - TIMEOUT, |
1834 | | - |
1835 | | - /** |
1836 | | - * Some error has occurred regarding the network. |
1837 | | - */ |
1838 | | - NETWORK_ERROR, |
1839 | | - |
1840 | | - /** |
1841 | | - * View is empty. |
1842 | | - */ |
1843 | | - NO_WIDGET, |
1844 | | - |
1845 | | - /** |
1846 | | - * Init request was not successful. |
1847 | | - */ |
1848 | | - INIT_FAILED, |
1849 | | - |
1850 | | - /** |
1851 | | - * Placeholder string mismatch. |
1852 | | - */ |
1853 | | - UNKNOWN_PLACEHOLDER, |
1854 | | - |
1855 | | - /** |
1856 | | - * Catch-all for all issues. |
1857 | | - */ |
1858 | | - UNKNOWN; |
1859 | | - |
1860 | | - /** |
1861 | | - * Returns the enum constant matching the provided string. |
1862 | | - * If no match is found, UNKNOWN is returned. |
1863 | | - * |
1864 | | - * @param value the name of the enum constant to look up |
1865 | | - * @return the corresponding UnloadReasons constant or UNKNOWN if no match is found |
1866 | | - */ |
1867 | | - public static UnloadReasons from(String value) { |
1868 | | - for (UnloadReasons reason : UnloadReasons.values()) { |
1869 | | - if (reason.name().equals(value)) { |
1870 | | - return reason; |
1871 | | - } |
1872 | | - } |
1873 | | - return UNKNOWN; |
1874 | | - } |
1875 | | - } |
1876 | | - |
1877 | | - |
1878 | | - /** |
1879 | | - * Rokt Integration |
1880 | | - * */ |
1881 | | - public class Rokt{ |
1882 | | - protected Rokt(){ |
1883 | | - |
1884 | | - } |
1885 | | - |
1886 | | - public void selectPlacements(@NonNull String viewName, |
1887 | | - @NonNull Map<String, String> attributes, |
1888 | | - @Nullable MpRoktEventCallback callbacks, |
1889 | | - @Nullable Map<String, WeakReference<RoktEmbeddedView>> placeHolders, |
1890 | | - @Nullable Map<String, WeakReference<Typeface>> fontTypefaces, |
1891 | | - @Nullable RoktConfig config) { |
1892 | | - if (mConfigManager.isEnabled()) { |
1893 | | - mKitManager.execute(viewName, |
1894 | | - attributes, |
1895 | | - callbacks, |
1896 | | - placeHolders, |
1897 | | - fontTypefaces, |
1898 | | - config); |
1899 | | - } |
1900 | | - } |
1901 | | - |
1902 | | - public void selectPlacements(@NonNull String viewName, |
1903 | | - @NonNull Map<String, String> attributes) { |
1904 | | - if (mConfigManager.isEnabled()) { |
1905 | | - mKitManager.execute(viewName, |
1906 | | - attributes, |
1907 | | - null, |
1908 | | - null, |
1909 | | - null, |
1910 | | - null |
1911 | | - ); |
1912 | | - } |
1913 | | - } |
1914 | | - |
1915 | | - public void purchaseFinalized(@NonNull String placementId, @NonNull String catalogItemId, boolean status) { |
1916 | | - if (mConfigManager.isEnabled()) { |
1917 | | - mKitManager.purchaseFinalized(placementId, catalogItemId, status); |
1918 | | - } |
1919 | | - } |
1920 | | - } |
1921 | 1788 | /** |
1922 | 1789 | * @hidden |
1923 | 1790 | */ |
|
0 commit comments