Skip to content

DataUrl not working in some android devices. #367

@TikshaK

Description

@TikshaK

I am using a base64 string as dataurl and bgSrc prop to show the image in the background and each time the modal is opened a new url comes and that is set in dataurl. It works fine in most of the devices (iOS and android) but in some android devices, It is giving issue for the release build. The modal opens and the dataurl Image appears for some time(it blink) and then nothing is there in the background.
I tried giving url to key prop as suggested in issue #347 by @YanYuanFE but it gives the same issue.
Please help if anybody can![

media_20241003_144835_1211646929666502506.mp4

](url)

    <View
        style={[
            styles.container,
            {
                backgroundColor: "rgba(0,0,0,0.8)",
                justifyContent: "center"
            }
        ]}
        pointerEvents={modalLoader ? 'none' : 'auto'}
    >
        <ActivityIndicator
            style={{
                position: "absolute",
                zIndex: 10,
                alignSelf: "center",
                top: sWidth * 0.95
            }}
            animating={modalLoader}
            size={sWidth * 0.1}
            color={Colors.primaryDark}
        />
        {
            backImg !="" &&

        
        <View
            style={{
                alignSelf: 'center',
                borderWidth: 1,
                width: sWidth * 0.9,
                height: sWidth * 0.9 * (3 / 4),
                justifyContent: "center",
                borderColor: Colors.primaryDark,
            }}
            pointerEvents={modalLoader ? 'none' : 'auto'}
        >

            <TouchableOpacity
                onPressIn={(evt) => handlePress(evt)}
                onLayout={handleLayout}
                style={{
                    width: "100%",
                    height: "100%"
                }}
            >
                {/* {
                    (backImg && backImg != null) &&
                } */}
                <SignatureScreen
                    dotSize={dot}
                    style={{
                        width: "100%",
                        height: "100%"
                    }}
                    // key={backImg}
                    onEnd={handleEnd}
                    onOK={handleOK}
                    onEmpty={handleEmpty}
                    onClear={handleClear}
                    onGetData={handleData}
                    ref={ref}
                    onBegin={(sig) => {
                        ref?.current?.readSignature()
                        setModalLoader(true)
                    }}
                    penColor={dotColor}
                    webStyle={styleButton}
                    dataURL={backImg}
                    bgSrc={backImg}
                    confirmText="Save to gallery"
                />
            </TouchableOpacity>
        </View>

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions