π λͺ°μ νλκ±Έ μ’μνλ κ°λ°μ μ λλ€.
- Language: Javascript, TypeScript, C, Python
- Skills : React, React Native, Expo, Node.js, GitHub Actions, React Three Fiber, Canvas API
π€ Programmatically change the app icon in Expo.
How come there is no default alert dialog when the icon gets changed? I thought it was enabled by default
for android this requires the manifest to be edited and expo doesn't let you do that very easily, you have to make a patch that runs on compiletime, ideally the readme should mention that this is required for the managed workflow or perhaps maybe even provide an example patch
Would be nice if this plugins is supporting Expo SDK 50.
The alias don't respect the intent filter that has the scheme.
For others, workaround is to warn users and reset the icon. Not pretty.
Hi Outsung,
first of all, thank you for you effort and this repo.
When I try to import
import { getAppIcon, setAppIcon } from "expo-dynamic-app-icon";
Im getting this error, do you have any idea how to fix it? I have tried to reinstall, but it doenst help.
caught Error: Cannot find native module 'ExpoDynamicAppIcon'
at requireNativeModule (requireNativeModule.ts:42:1)
at ./node_modules/expo-dynamic-app-icon/build/ExpoDynamicAppIconModule.js (ExpoDynamicAppIconModule.ts:5:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at ./node_modules/expo-dynamic-app-icon/build/index.js (ExpoDynamicAppIconModule.ts:5:1)
Best regards
BjΓΆrn
this repo hasn't had any activity in a couple months, are there still plans to implement this?
With iOS 18 we can provide dark and tinted icon variants. It would be great to support this in the generated output.
the module can't build on windows atm due to expo-build-scripts not being able to be used on windows
For the new Expo SDK Release there needs to be a change.
classifier should be replaced by archiveClassifier
Otherwise the EAS build will fail.
You can finde the migration guide here: https://expo.fyi/expo-modules-gradle8-migration
Hi, thank you very much for you job on expo-dynamic-app-icon.
On Android, after call of setAppIcon(), on first loss of app focus, the App is closed (certainly to apply icon).
So, if App request for permissions (notification, localisation or else), it closes automatically : it looks like a bug for the user.
Is there anyway to avoid that on android ?
Morever, could you easly implements getIconName() in addition to setAppIcon() : it will allow to check if icon need to be changed.
On some Android devices, install/uninstall restores initial Icon but storage is restored as before, so it's not possible to use storage to know if icon App has been changed by reinstallation.
Thanks for your help.
(note using #18 for sdk 50 compatability)
it seems that the package has no effect when the application is built as standalone using xcodebuild instead of expo cli
using expo run:ios
works perfectly fine both on iOS simulator and real iOS device
using
expo prebuild --platform=ios && cd ios && xcodebuild -workspace project.xcworkspace -scheme project -configuration Release -derivedDataPath build -destination generic/platform=iOS CODE_SIGN_IDENTITY=\"\"
to build a standalone iOS app however yields in no icon change whatsoever
I'm not sure what exactly the differences are but I think xcodebuild might be using a different bundling configuration, the Build Phase that bundles the rn files launches expo export:embed
according to the script so perhaps that somehow omits assets, I am truly not sure, I tried everything to figure out what exactly causes this but alas was not successful
I noticed on Android that when we change the icon it creates new icon on home screen instead of updating the old one,
so each time we change icon it adds new one,
is this a know bug or it's an issue on my end?
how about add background and more size attribute for this plugin
I'm trying to change the icon, Expo SDK 49, custom expo-dev-client.
My expo.plugins in app.json:
"plugins": [
"expo-apple-authentication",
"@react-native-firebase/app",
"@react-native-firebase/auth",
[
"expo-build-properties",
{
"ios": {
"useFrameworks": "static"
}
}
],
"expo-localization",
"expo-dynamic-app-icon",
[
"expo-dynamic-app-icon",
{
"gorg": {
"image": "./assets/gorg-icon.png",
"prerendered": true
},
"little-gorg": {
"image": "./assets/little-gorg.png",
"prerendered": true
}
}
]
]
import { TouchableOpacity, View, Image } from "react-native";
import * as Haptics from "expo-haptics";
import { getAppIcon, setAppIcon } from "expo-dynamic-app-icon";
import { useTheme } from "@react-navigation/native";
const IconSwitcher = ({ icon, onPress }) => {
const activeIcon = getAppIcon();
console.log("activeIcon", activeIcon)
const isActive = activeIcon === icon.name;
const theme = useTheme();
return (
<View
style={{
borderWidth: isActive ? 2 : 0,
padding: 5,
alignItems: "center",
justifyContent: "center",
}}
>
<TouchableOpacity
onPress={() => {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);
console.log("icon.name", icon.name)
const result = setAppIcon(icon.name);
console.log('result', result)
//returns "gorg" or "little-gorg" respectively
onPress();
}}
>
<Image
source={icon.image}
style={{ height: 75, aspectRatio: 1, borderRadius: 20 }}
/>
</TouchableOpacity>
</View>
);
};
export default IconSwitcher;
Even if I get the returned icon name when calling setAppIcon (as if it succeeded), it does not update the app icon, even if I reload the app.
When I run, I get "DEFAULT". It seems like it isn't changing it at all. I have double-checked that the images are at the correct path.
const activeIcon = getAppIcon();
console.log("activeIcon", activeIcon)
// returns "DEFAULT"
I am having this issue when user opens the Alias Activity for the second time... It seems that he can't closes the app.
Unable to pause activity {com.package.android/.MainActivityRed}: java.lang.reflect.InvocationTargetException
Related issue:
expo/expo#15298
Maybe it is something related to this file:
https://github.com/outsung/expo-dynamic-app-icon/blob/main/android/src/main/java/expo/modules/dynamicappicon/ExpoDynamicAppIconReactActivityLifecycleListener.kt
My expo app always fails to build and i get this error:
Execution failed for task ':expo-dynamic-app-icon:compileReleaseKotlin'.
> 'compileReleaseJavaWithJavac' task (current target is 17) and 'compileReleaseKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 7m 45s
927 actionable tasks: 927 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
building on iOS works fine, issue only happens on android.
Hello,
Everytime we submit an application with dynamic icons to Apple Store we receive the mail below from Apple (this is a non-blocking notice).
"
ITMS-90892: Missing recommended icon - The bundle does not contain an alternate app icon for iPad of exactly '167x167' pixels, in .png format for iOS versions supporting iPad Pro. To support older operating systems, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleicons
ITMS-90892: Missing recommended icon - The bundle does not contain an alternate app icon for iPad of exactly '152x152' pixels, in .png format for iOS versions >= 10.0. To support older operating systems, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleicons
"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.