Coder Social home page Coder Social logo

outsung / expo-dynamic-app-icon Goto Github PK

View Code? Open in Web Editor NEW
105.0 105.0 21.0 1.02 MB

πŸ€– Programmatically change the app icon in Expo.

JavaScript 4.13% Kotlin 6.22% TypeScript 22.56% Ruby 5.52% Objective-C 0.68% Objective-C++ 11.47% Swift 2.09% Starlark 3.41% Java 30.63% CMake 0.50% C++ 12.79%
expo react-native

expo-dynamic-app-icon's Introduction

Hits

πŸ‘ λͺ°μž…ν•˜λŠ”κ±Έ μ’‹μ•„ν•˜λŠ” 개발자 μž…λ‹ˆλ‹€.

  • Language: Javascript, TypeScript, C, Python
  • Skills : React, React Native, Expo, Node.js, GitHub Actions, React Three Fiber, Canvas API


expo-dynamic-app-icon's People

Contributors

jeffthemaximum avatar mariomurrent-softwaresolutions avatar outsung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

expo-dynamic-app-icon's Issues

more details in readme / disclaimer for managed workflow

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

Issue with ExpoDynamicAppIcon

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

progess report?

this repo hasn't had any activity in a couple months, are there still plans to implement this?

Feature request : implements getIconName()

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.

no functionality when built via xcodebuild

(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

Android icon duplicate when changed

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?

Not changing Icon

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"

Gradle build fails for android because of this package (works fine on iOS)

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.

Apple notice on application submit

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
"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.