Skip to content
4 changes: 2 additions & 2 deletions integration-testing/ts/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import {
} from 'react-native';

import {
Iterable,
IterableConfig,
IterableAction,
IterableActionContext,
IterableInAppShowResponse,
IterableInAppLocation,
IterableInAppDeleteSource,
} from '@iterable/react-native-sdk';

import { Iterable } from '@iterable/react-native-sdk/js/Iterable';
import IterableConfig from '@iterable/react-native-sdk/js/IterableConfig';
import IterableInAppMessage from '@iterable/react-native-sdk/js/IterableInAppMessage';

import { Login } from './Login'
Expand Down
15 changes: 8 additions & 7 deletions integration-testing/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,11 @@
dependencies:
"@hapi/hoek" "^8.3.0"

"@iterable/react-native-sdk@^1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@iterable/react-native-sdk/-/react-native-sdk-1.3.1.tgz#811f2f97a0337e60a6ce7f14f8927496d4a3b238"
integrity sha512-kjaYNKt3nPcwUbEWvcmKKvM4wYPbKZuZ9uT6U5azDfon4l0XAu0KYwJVoovmkDi+egDyb4yAkIfFGIhCNOvVWQ==
"@iterable/react-native-sdk@^1.3.2":
version "1.3.2"
resolved "https://registry.yarnpkg.com/@iterable/react-native-sdk/-/react-native-sdk-1.3.2.tgz#03aff1b440b7b4f58b982ebc292d4500830569f6"
integrity sha512-s+TTXQUOvcjAyp4lB9g42moAOPjiN7Gd4zWCvicO+zNcF170oZ8zSw/CJoUxvZIaFqKYIJXREeECBuDpA/p3Nw==

dependencies:
"@react-native-community/hooks" "^2.6.0"
"@react-navigation/native" "^6.0.6"
Expand Down Expand Up @@ -4728,9 +4729,9 @@ react-native-vector-icons@^9.0.0:
yargs "^16.1.1"

react-native-webview@^11.14.1:
version "11.21.1"
resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-11.21.1.tgz#9d777b592a2f6802a8adb07e90e8cdaafc15d109"
integrity sha512-0136xrXV1VYMLj9yqma/8lNjUAoTa9uUYjAXlnkX8gSZbp4Bfk7VjDgXM2DCuYF/Pqzrq37hqYVyV+Hl/5zzlQ==
version "11.21.2"
resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-11.21.2.tgz#fe4675318b8e487a4347d30f3036bfb89ba5a09b"
integrity sha512-BgiRfRfB9J60dEzj6Z4fZQcKhPbqGhinweHdIMFtLm9GCaTZ/cTo3sOeMN9XuLgakqcqHnvHg7Abp5jT2aiOyw==
dependencies:
escape-string-regexp "2.0.0"
invariant "2.2.4"
Expand Down
46 changes: 25 additions & 21 deletions ts/IterableInbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ type inboxProps = {
customizations?: IterableInboxCustomizations,
tabBarHeight?: number,
tabBarPadding?: number,
safeAreaMode?: boolean
safeAreaMode?: boolean,
showNavTitle?: boolean
}

const IterableInbox = ({
Expand All @@ -50,7 +51,8 @@ const IterableInbox = ({
customizations = {} as IterableInboxCustomizations,
tabBarHeight = 80,
tabBarPadding = 20,
safeAreaMode = true
safeAreaMode = true,
showNavTitle = true
}: inboxProps) => {
const defaultInboxTitle = "Inbox"
const inboxDataModel = new IterableInboxDataModel()
Expand Down Expand Up @@ -243,9 +245,11 @@ const IterableInbox = ({
function showMessageList(loading: boolean) {
return (
<View style={messageListContainer}>
<Text style={headline}>
{customizations?.navTitle ? customizations?.navTitle : defaultInboxTitle}
</Text>
{showNavTitle ?
<Text style={headline}>
{customizations?.navTitle ? customizations?.navTitle : defaultInboxTitle}
</Text>
: null}
{rowViewModels.length ?
<IterableInboxMessageList
dataModel={inboxDataModel}
Expand Down Expand Up @@ -289,22 +293,22 @@ const IterableInbox = ({
const inboxAnimatedView =
<Animated.View
style={{
transform: [
{
translateX: animatedValue.interpolate({
inputRange: [0, 1],
outputRange: [0, -width]
})
}
],
height: '100%',
flexDirection: 'row',
width: 2 * width,
justifyContent: 'flex-start'
}}
>
{showMessageList(loading)}
{showMessageDisplay(rowViewModels, selectedRowViewModelIdx)}
transform: [
{
translateX: animatedValue.interpolate({
inputRange: [0, 1],
outputRange: [0, -width]
})
}
],
height: '100%',
flexDirection: 'row',
width: 2 * width,
justifyContent: 'flex-start'
}}
>
{showMessageList(loading)}
{showMessageDisplay(rowViewModels, selectedRowViewModelIdx)}
</Animated.View>

return(
Expand Down
12 changes: 12 additions & 0 deletions ts/IterableInboxMessageDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,24 @@ const IterableInboxMessageDisplay = ({
Iterable.trackInAppClick(rowViewModel.inAppMessage, IterableInAppLocation.inbox, URL)
Iterable.trackInAppClose(rowViewModel.inAppMessage, IterableInAppLocation.inbox, IterableInAppCloseSource.link, URL)

//handle delete action
if (URL === 'iterable://delete') {
returnToInbox(() => deleteRow(rowViewModel.inAppMessage.messageId))
//handle dismiss action
} else if(URL === 'iterable://dismiss') {
returnToInbox()
//handle external link
} else if (URL.slice(0, 4) === 'http') {
returnToInbox(() => Linking.openURL(URL))
//handle custom action
} else if (URL.slice(0,9) === 'action://') {
action.type = URL.replace('action://', '')
returnToInbox(() => {
if(Iterable.savedConfig.customActionHandler) {
Iterable.savedConfig.customActionHandler(action, context)
}
})
//handle deep link or error link
} else {
returnToInbox(() => {
if(Iterable.savedConfig.urlHandler) {
Expand Down