iterable-android-sdk icon indicating copy to clipboard operation
iterable-android-sdk copied to clipboard

Opening the Inbox Fragment using NavGraph, not using passed in Arguments

Open wlynnlt opened this issue 1 year ago • 0 comments
trafficstars

using this code for the navgraph

<fragment
    android:id="@+id/inboxFragment"
    android:name="com.iterable.iterableapi.ui.inbox.IterableInboxMessageFragment"
    android:label="Inbox">

    <argument
        android:name="noMessagesTitle"
        app:argType="string" />

    <argument
        android:name="noMessagesBody"
        app:argType="string" />

</fragment>

and launching the inbox like this
inboxFragment(noMessagesBody = "no messages", noMessagesTitle = "no title body"))

The arguments are not used by the fragment.
But using the arguments like

 var bundle = Bundle()
    bundle.putString(IterableConstants.NO_MESSAGES_TITLE,"No saved messages")
    bundle.putString(IterableConstants.NO_MESSAGES_BODY, "Check again later!")
    val fragment: Fragment = instantiate(  requireContext()  , IterableInboxFragment::class.java.name, bundle)
    
    The fragment is opened and the custom text is rendered.
    Please let me know if I am using the navGraph code wrong.

wlynnlt avatar Mar 11 '24 16:03 wlynnlt