-
Notifications
You must be signed in to change notification settings - Fork 325
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
[🐛] 🔥 No suitable URL request handler found for ph:// #2868
Comments
Hey @fathulfahmy, what's your stream-chat-expo, expo and expo-media-library version? |
Expo version: 52.0.20 Full configuration in environment tab included in opened issue |
@fathulfahmy you are running the app on new architecture, right? |
Yes, as it is the default behavior for Expo SDK 52 |
Hey @fathulfahmy the latest of expo 52 is 52.0.23 how are you on expo 52.0.43? Can you run |
@khushal87 I apologize as I misreferenced expo version number. Corrected expo version is 52.0.20. I have also ran Full |
It works for expo ~52.0.20 and expo-media-library ~17.0.4 for me, expo-image-manipulator being ~13.0.5. Did you clear your cache and run the app again? |
The issue still persists upon opening camera roll initially. The issue only occurs on iOS but not on Android. I have tried:
Channelimport React from "react";
import { router } from "expo-router";
import { Channel, MessageInput, MessageList } from "stream-chat-expo";
import { LoadingStateScreen } from "@/components/screens";
import { useChat } from "@/lib/stream-chat/chat-store";
export const Conversation = () => {
const { channel, setThread } = useChat();
if (!channel) return <LoadingStateScreen />;
return (
<Channel channel={channel} keyboardVerticalOffset={90}>
<MessageList
onThreadSelect={(thread) => {
setThread(thread);
router.push(`/chat/${channel.cid}/thread/${thread?.cid}`);
}}
/>
<MessageInput />
</Channel>
);
};
|
Yep, it was an iOS-only issue on new architecture, too, but we fixed it, and the version upgrade doesn't seem to cause it for us anymore, so it's weird that it happens for you. We will try to triage more and get back to you if we find something. The bottom sheet being open and closed is a known issue for us. |
I have found a workaround to this matter. I created a custom attach button component from the official Stream Chat React Native v6 documentation and Expo ImagePicker. ResultCodeCustom Attach Buttonimport { useActionSheet } from "@expo/react-native-action-sheet";
import * as ImagePicker from "expo-image-picker";
import { AttachButton, useMessageInputContext } from "stream-chat-expo";
export const CustomAttachButton = () => {
const { showActionSheetWithOptions } = useActionSheet();
const { pickFile, uploadNewImage } = useMessageInputContext();
const pickImageFromGallery = async () => {
const permission = await ImagePicker.requestMediaLibraryPermissionsAsync();
if (permission.granted) {
let result = await ImagePicker.launchImageLibraryAsync({
allowsMultipleSelection: true,
});
if (!result.canceled) {
result.assets.forEach((image) => {
uploadNewImage({
uri: image.uri,
});
});
}
} else {
alert("Permission to media library is required");
}
};
const pickImageFromCamera = async () => {
const permission = await ImagePicker.requestCameraPermissionsAsync();
if (permission.granted) {
let result = await ImagePicker.launchCameraAsync({
allowsEditing: true,
});
if (!result.canceled) {
uploadNewImage({
uri: result.assets[0].uri,
});
}
} else {
alert("Permission to camera is required");
}
};
const onPress = () => {
// Same interface as https://facebook.github.io/react-native/docs/actionsheetios.html
showActionSheetWithOptions(
{
cancelButtonIndex: 3,
destructiveButtonIndex: 3,
options: ["Photo Library", "Camera", "Files", "Cancel"],
},
(buttonIndex) => {
switch (buttonIndex) {
case 0:
pickImageFromGallery();
break;
case 1:
pickImageFromCamera();
break;
case 2:
pickFile();
break;
default:
break;
}
},
);
};
return <AttachButton handleOnPress={onPress} />;
};
Channelimport React from "react";
import { router } from "expo-router";
import { Channel, MessageInput, MessageList } from "stream-chat-expo";
import { useChat } from "@/lib/stream-chat/chat-store";
import { CustomAttachButton } from "./custom-attach-button";
export const Conversation = () => {
/* ======================================== HOOKS */
const { channel, setThread } = useChat();
/* ======================================== RETURNS */
if (!channel) return null;
return (
<Channel channel={channel} keyboardVerticalOffset={90} AttachButton={CustomAttachButton}>
<MessageList
onThreadSelect={(thread) => {
setThread(thread);
router.push(`/chat/${channel.cid}/thread/${thread?.cid}`);
}}
/>
<MessageInput />
</Channel>
);
};
Root Layoutconst RootLayout = () => {
const theme = AppLightTheme;
useOnlineManager();
useAppState(onAppStateChange);
useReactQueryDevTools(queryClient);
return (
<PaperProvider theme={theme}>
<QueryClientProvider client={queryClient}>
<AuthTokenProvider>
<SafeAreaProvider>
<GestureHandlerRootView>
{/* Wrap root layout with ActionSheetProvider */}
<ActionSheetProvider>
<StreamChatProvider>
<StripePaymentProvider>
<StatusBar style="light" backgroundColor={theme.colors.primary} />
<Stack>
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="(auth)" options={{ headerShown: false }} />
<Stack.Screen name="+not-found" />
</Stack>
<StatusDialog />
<ConfirmationDialog />
<Notification />
</StripePaymentProvider>
</StreamChatProvider>
</ActionSheetProvider>
</GestureHandlerRootView>
</SafeAreaProvider>
</AuthTokenProvider>
</QueryClientProvider>
</PaperProvider>
);
};
export default RootLayout;
References |
Issue
Image picker returns error
No suitable URL request handler found for ph://
on iOS (Expo Go) on initial render, but works fine after error is dismissed.Steps to reproduce
Steps to reproduce the behavior:
+
+
again+
againExpected behavior
Image picker bottom sheet returns no error initially on iOS (Expo Go)
Project Related Information
Customization
Click To Expand
Offline support
Environment
Click To Expand
package.json
:react-native info
output:stream-chat-react-native
version you're using that has this issue:stream-chat-expo: ^6.0.1
Expo SDK 52
Expo Go
Additional context
Screenshots
Click To Expand
The text was updated successfully, but these errors were encountered: