-
Notifications
You must be signed in to change notification settings - Fork 42
[MOB-7052] Embedded messaging feature #751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lposen
wants to merge
67
commits into
master
Choose a base branch
from
loren/embedded/master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 30 commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
1ac7370
docs: add Embedded component to example app
lposen 15e1894
feat: add IterableEmbeddedManager class and update exports for embedd…
lposen f81b52d
Merge branch 'jwt/MOB-12298-new-improve-logger' into loren/embedded/M…
lposen 952eebe
Merge branch 'loren/embedded/MOB-12260-create-embedded-tab-in-example…
lposen 2a62913
feat: add embeddedManager property to Iterable class for managing emb…
lposen 789ae83
refactor: remove unused methods and improve documentation in Iterable…
lposen 9940f46
docs: enhance documentation
lposen e7d4ecb
feat: add embeddedMessagingEnabled property to IterableConfig
lposen 12ee8fd
feat: enable embedded messaging configuration in RNIterableAPIModuleImpl
lposen 93402fd
feat: update IterableConfig with prop that matches android name
lposen b916fb3
feat: implement getEmbeddedPlacementIds
lposen f456e20
feat: add Embedded tab to Main component in example app
lposen 4441759
Merge branch 'loren/embedded/MOB-12260-create-embedded-tab-in-example…
lposen 8201c4d
feat: display embedded manager status in Embedded component
lposen 3f5fa41
Merge branch 'loren/embedded/MOB-12261-add-embedded-manager-class' in…
lposen b0e17f9
feat: add functionality to retrieve and display placement IDs in Embe…
lposen d42dd73
feat: implement methods to retrieve and sync embedded messages in RNI…
lposen 67278b7
refactor: add sync and get messages
lposen 06a94fc
refactor: remove unused methodss
lposen 80ec4fc
refactor: remove commented-out error handling in Embedded component
lposen 1bee2d6
feat: add session management methods to IterableEmbeddedManager
lposen 0ba0b7f
docs: enhance session management method documentation in IterableEmbe…
lposen 24d5a70
feat: add startEmbeddedSession method
lposen be8998a
feat: add endEmbeddedSession method and update session management in …
lposen cbb547f
docs: update IterableEmbeddedManager documentation to clarify enableE…
lposen 760a9e3
feat: add syncEmbeddedMessages method
lposen 1986caa
feat: implement getEmbeddedMessages method and add example on embedded
lposen 94e46a6
feat: enhance Embedded component with ScrollView and button details d…
lposen e13756e
feat: implement setEnabled method for managing embedded manager state
lposen 0e68107
Merge branch 'jwt/master' into loren/embedded/master
lposen 28173ed
Merge branch 'loren/embedded/master' into loren/embedded/MOB-12260-cr…
lposen f0ff3f8
Merge branch 'jwt/master' into loren/embedded/master
lposen 0be3376
Merge branch 'loren/embedded/master' into loren/embedded/MOB-12260-cr…
lposen 79926df
Merge branch 'loren/embedded/MOB-12260-create-embedded-tab-in-example…
lposen ae09cb0
Merge remote-tracking branch 'origin/loren/embedded/MOB-12261-add-emb…
lposen c115493
Apply suggestions from code review
lposen 25ec86d
feat: add chat icon to route configuration in App.constants.ts
lposen 5206902
Merge branch 'loren/embedded/MOB-12260-create-embedded-tab-in-example…
lposen 2b4da8a
refactor: wrap components in SafeAreaView for improved layout consist…
lposen 2a5ac95
Merge branch 'loren/embedded/MOB-12261-add-embedded-manager-class' in…
lposen 11f8227
feat: refactor IterableEmbeddedManager to use private variable
lposen 935cf22
test: enhance Iterable configuration tests with additional assertions
lposen 047f94b
fix: update embeddedMessagingEnabled configuration to use nullish coa…
lposen 92c8c9e
test: add unit tests for IterableEmbeddedManager and enhance Iterable…
lposen 59da91a
Merge branch 'loren/embedded/MOB-12261-add-embedded-manager-class' in…
lposen eb0dff5
Merge branch 'loren/embedded/MOB-12263-android-add-ability-to-sync-em…
lposen efbda57
feat: update login function to support JWT token retrieval and enhanc…
lposen 67e116b
fix: update example usage of startSession and endSession methods in I…
lposen bab2b35
test: add unit tests for new embedded session methods in IterableEmbe…
lposen bb0c200
Merge branch 'loren/embedded/MOB-12265-start-end-session' into loren/…
lposen 0984e9e
test: add unit tests for syncEmbeddedMessages and getEmbeddedMessages…
lposen 62e248f
refactor: remove embedded messaging configuration from RNIterableAPIM…
lposen 074d64f
Merge branch 'master' into loren/embedded/master
lposen 733ebd3
Merge branch 'loren/embedded/master' into loren/embedded/MOB-12260-cr…
lposen d365761
Merge branch 'loren/embedded/MOB-12260-create-embedded-tab-in-example…
lposen d4c89e8
Merge branch 'loren/embedded/MOB-12261-add-embedded-manager-class' in…
lposen fd42bac
Merge branch 'loren/embedded/MOB-12263-android-add-ability-to-sync-em…
lposen 1014a49
Merge branch 'loren/embedded/MOB-12265-start-end-session' into loren/…
lposen f5746ac
Merge pull request #741 from Iterable/loren/embedded/MOB-12260-create…
lposen b3ce46c
Merge branch 'loren/embedded/master' into loren/embedded/MOB-12261-ad…
lposen 2c7a839
Merge pull request #742 from Iterable/loren/embedded/MOB-12261-add-em…
lposen e0e83b2
Merge pull request #744 from Iterable/loren/embedded/MOB-12263-androi…
lposen 433a089
Merge branch 'loren/embedded/master' into loren/embedded/MOB-12265-st…
lposen 834f2ab
Merge branch 'loren/embedded/MOB-12265-start-end-session' into loren/…
lposen c578308
Merge pull request #745 from Iterable/loren/embedded/MOB-12265-start-…
lposen 256d8d1
Merge branch 'loren/embedded/master' into loren/embedded/MOB-12264-an…
lposen 1c82b83
Merge pull request #746 from Iterable/loren/embedded/MOB-12264-androi…
lposen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,59 @@ | ||
| /* eslint-disable react-native/split-platform-components */ | ||
| import { createNativeStackNavigator } from '@react-navigation/native-stack'; | ||
| import { useEffect } from 'react'; | ||
| import { PermissionsAndroid, Platform } from 'react-native'; | ||
|
|
||
| import { Route } from '../../constants/routes'; | ||
| import { useIterableApp } from '../../hooks/useIterableApp'; | ||
| import type { RootStackParamList } from '../../types'; | ||
| import { Login } from '../Login'; | ||
| import { Main } from './Main'; | ||
| import type { RootStackParamList } from '../../types'; | ||
|
|
||
| const Stack = createNativeStackNavigator<RootStackParamList>(); | ||
|
|
||
| const requestNotificationPermission = async () => { | ||
| if (Platform.OS === 'android') { | ||
| const apiLevel = Platform.Version; // Get the Android API level | ||
|
|
||
| if (apiLevel >= 33) { | ||
| // Check if Android 13 or higher | ||
| try { | ||
| const granted = await PermissionsAndroid.request( | ||
| PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS, | ||
| { | ||
| title: 'Notification Permission', | ||
| message: | ||
| 'This app needs access to your notifications for push, in-app messages, embedded messages and more.', | ||
| buttonNeutral: 'Ask Me Later', | ||
| buttonNegative: 'Cancel', | ||
| buttonPositive: 'OK', | ||
| } | ||
| ); | ||
| if (granted === PermissionsAndroid.RESULTS.GRANTED) { | ||
| console.log('Notification permission granted'); | ||
| } else { | ||
| console.log('Notification permission denied'); | ||
| } | ||
| } catch (err) { | ||
| console.warn(err); | ||
| } | ||
| } else { | ||
| // For Android versions below 13, notification permission is generally not required | ||
| // or is automatically granted upon app installation. | ||
| console.log( | ||
| 'Notification permission not required for this Android version.' | ||
| ); | ||
| } | ||
| } | ||
qltysh[bot] marked this conversation as resolved.
Show resolved
Hide resolved
qltysh[bot] marked this conversation as resolved.
Show resolved
Hide resolved
qltysh[bot] marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }; | ||
|
|
||
| export const App = () => { | ||
| const { isLoggedIn } = useIterableApp(); | ||
|
|
||
| useEffect(() => { | ||
| requestNotificationPermission(); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <Stack.Navigator> | ||
| {isLoggedIn ? ( | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { StyleSheet } from 'react-native'; | ||
| import { button, buttonText, container, hr } from '../../constants'; | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| button, | ||
| buttonText, | ||
| container: { ...container, paddingHorizontal: 0 }, | ||
| embeddedSection: { | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: 16, | ||
| paddingHorizontal: 16, | ||
| }, | ||
| hr, | ||
| text: { textAlign: 'center' }, | ||
| utilitySection: { | ||
| paddingHorizontal: 16, | ||
| }, | ||
| }); | ||
|
|
||
| export default styles; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { Iterable } from '@iterable/react-native-sdk'; | ||
| import { Text } from 'react-native'; | ||
| import { SafeAreaView } from 'react-native-safe-area-context'; | ||
|
|
||
| import styles from './Embedded.styles'; | ||
|
|
||
| export const Embedded = () => { | ||
| return ( | ||
| <SafeAreaView style={styles.container}> | ||
| <Text style={styles.text}>EMBEDDED</Text> | ||
| <Text style={styles.text}> | ||
| Does embedded class exist? {Iterable.embeddedManager ? 'Yes' : 'No'} | ||
| </Text> | ||
| <Text style={styles.text}> | ||
| Is embedded manager enabled?{' '} | ||
| {Iterable.embeddedManager.isEnabled ? 'Yes' : 'No'} | ||
| </Text> | ||
| </SafeAreaView> | ||
| ); | ||
| }; | ||
|
|
||
| export default Embedded; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './Embedded'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| export * from './colors'; | ||
| export * from './containers'; | ||
| export * from './formElements'; | ||
| export * from './miscElements'; | ||
| export * from './shadows'; | ||
| export * from './typography'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { type ViewStyle } from 'react-native'; | ||
| import { colors } from './colors'; | ||
|
|
||
| export const hr: ViewStyle = { | ||
| backgroundColor: colors.borderPrimary, | ||
| height: 1, | ||
| marginVertical: 20, | ||
| marginHorizontal: 0, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.