obytes/app-icon-badge

Can't get it to work

Closed this issue · 7 comments

Hello, I've been struggling to get this plugin to work for a while now.

This is my expo config file:

/* eslint-disable max-lines-per-function */
import type { ConfigContext, ExpoConfig } from "@expo/config";

import { ClientEnv, Env } from "./env";

export default ({ config }: ConfigContext): ExpoConfig => ({
  ...config,
  name: Env.NAME,
  description: `${Env.NAME} Mobile App`,
  owner: Env.EXPO_ACCOUNT_OWNER,
  version: Env.VERSION.toString(),
  orientation: "portrait",
  icon: "./src/assets/images/logos/alleen-ramen-vierkant.png",
  splash: {
    image: "./src/assets/images/logos/logo-rechthoek-padding.png",
    resizeMode: "contain",
    backgroundColor: "#ffffff",
  },
  primaryColor: "#207DA2",
  slug: Env.SLUG,
  scheme: Env.SLUG,
  updates: {
    fallbackToCacheTimeout: 0,
  },
  userInterfaceStyle: "automatic",
  assetBundlePatterns: ["**/*"],
  ios: {
    bundleIdentifier: Env.BUNDLE_ID,
  },
  android: {
    adaptiveIcon: {
      foregroundImage: "./src/assets/images/logos/alleen-ramen-vierkant.png",
      backgroundColor: "#FFFFFF",
    },
    package: Env.PACKAGE,
  },
  plugins: [
    [
      "app-icon-badge",
      {
        enabled: true,
        badges: [
          {
            text: Env.APP_ENV,
            type: "banner",
            color: "#333333",
          },
          {
            text: Env.VERSION.toString(),
            type: "ribbon",
          },
        ],
      },
    ],
  ],
  extra: {
    ...ClientEnv,
    eas: {
      projectId: Env.EAS_PROJECT_ID,
    },
  },
});

Is there anything here I'm doing wrong? My icons are still my default ones.

yjose commented

@Joehoel Did you try to run prebuild and generate a new build ?

Yes I tried it countless times. Also production builds. But no luck.

same problem here. i am using the expo plugin with an expo managed workflow. the .expo/app-icon-badge images are generated correctly with a banner and ribbon. however, for some reason when i install the app on my device using an eas local build, the banner and ribbon do not appear

@dereklance @yjose

You have to add position option
Then it will work!

Thanks @bhyoo99, that worked. You should probably emphasize this in the README/examples. If I have time I can make a pull request for it :)

@bhyoo99 YUP :) I will update docs too. have a nice day!

yjose commented

Nice catch @bhyoo99 , we are setting default value for position so probably something is wrong with our implementation. @SihamBen can you please invistigate on this 🙏