├── .gitattributes
├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── config.yml
├── .gitignore
├── LICENSE
├── NativeChangeIcon.ts
├── README.md
├── android
├── build.gradle
├── gradle.properties
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── AndroidManifestNew.xml
│ └── java
│ └── com
│ └── reactnativechangeicon
│ ├── ChangeIconModule.java
│ └── ChangeIconPackage.java
├── dist
├── index.d.ts
└── index.js
├── docs
├── examples
│ ├── Step-1
│ │ ├── Icon - Dark.jpg
│ │ ├── Icon - Default.jpg
│ │ └── Icon - Light.jpg
│ ├── Step-3
│ │ ├── android
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_dark.png
│ │ │ │ └── ic_launcher_light.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_dark.png
│ │ │ │ └── ic_launcher_light.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_dark.png
│ │ │ │ └── ic_launcher_light.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_dark.png
│ │ │ │ └── ic_launcher_light.png
│ │ │ └── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_dark.png
│ │ │ │ └── ic_launcher_light.png
│ │ └── ios
│ │ │ ├── Dark.appiconset
│ │ │ ├── 1024.png
│ │ │ ├── 114.png
│ │ │ ├── 120.png
│ │ │ ├── 180.png
│ │ │ ├── 29.png
│ │ │ ├── 40.png
│ │ │ ├── 57.png
│ │ │ ├── 58.png
│ │ │ ├── 60.png
│ │ │ ├── 80.png
│ │ │ ├── 87.png
│ │ │ └── Contents.json
│ │ │ ├── Default.appiconset
│ │ │ ├── 1024.png
│ │ │ ├── 114.png
│ │ │ ├── 120.png
│ │ │ ├── 180.png
│ │ │ ├── 29.png
│ │ │ ├── 40.png
│ │ │ ├── 57.png
│ │ │ ├── 58.png
│ │ │ ├── 60.png
│ │ │ ├── 80.png
│ │ │ ├── 87.png
│ │ │ └── Contents.json
│ │ │ └── Light.appiconset
│ │ │ ├── 1024.png
│ │ │ ├── 114.png
│ │ │ ├── 120.png
│ │ │ ├── 180.png
│ │ │ ├── 29.png
│ │ │ ├── 40.png
│ │ │ ├── 57.png
│ │ │ ├── 58.png
│ │ │ ├── 60.png
│ │ │ ├── 80.png
│ │ │ ├── 87.png
│ │ │ └── Contents.json
│ └── Step-4
│ │ ├── AndroidManifest.xml
│ │ └── Info.plist
├── images
│ ├── icons-example-exported-android.png
│ ├── icons-example-exported.png
│ ├── icons-examples-dir.png
│ ├── icons-examples-generate.png
│ └── icons-examples-showcase.png
└── ios-example-app-icon.png
├── ios
├── ChangeIcon.h
├── ChangeIcon.mm
└── ChangeIcon.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ └── contents.xcworkspacedata
├── package.json
├── react-native-change-icon.podspec
├── react-native.config.js
├── src
└── index.ts
├── tsconfig.json
└── yarn.lock
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 | # specific for windows script files
3 | *.bat text eol=crlf
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: ["https://paypal.me/skb1129"]
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Report a reproducible bug or regression in this package.
4 | title: ''
5 | labels: ''
6 | assignees: skb1129
7 |
8 | ---
9 |
10 | **Platform**
11 | - [ ] iOS
12 | - [ ] Android
13 |
14 | **Description**
15 | A clear and concise description of what the bug is.
16 |
17 | **To Reproduce**
18 | Steps to reproduce the behavior:
19 | 1.
20 | 2.
21 |
22 | **Expected behavior**
23 | A clear and concise description of what you expected to happen.
24 |
25 | **Screenshots**
26 | If applicable, add screenshots to help explain your problem.
27 |
28 | **Device (please complete the following information):**
29 | - Device: [e.g. iPhone X]
30 | - OS: [e.g. iOS 12.1]
31 |
32 | **Versions**
33 | - react-native: [e.g. 0.62.2]
34 | - react-native-change-icon: [e.g. 2.0.3]
35 |
36 | **Code Snippet**
37 | Please provide a minimal code snippet of the setup that you did to use this package. [e.g. AndroidManifest.xml]
38 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | .DS_Store
3 |
4 | # VSCode
5 | .vscode/
6 | jsconfig.json
7 |
8 | # node.js
9 | node_modules/
10 | npm-debug.log
11 | yarn-debug.log
12 | yarn-error.log
13 |
14 | # Android
15 | local.properties
16 | .idea/
17 | .gradle/
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Surya Kant Bansal
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 |
--------------------------------------------------------------------------------
/NativeChangeIcon.ts:
--------------------------------------------------------------------------------
1 | import type { TurboModule } from 'react-native';
2 | import { TurboModuleRegistry } from 'react-native';
3 |
4 | export interface Spec extends TurboModule {
5 | readonly getConstants: () => {};
6 | changeIcon: (iconName?: string) => Promise;
7 | resetIcon: () => Promise;
8 | getIcon: () => Promise;
9 | }
10 |
11 | export default TurboModuleRegistry.get('ChangeIcon');
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
React Native Change Icon
3 | Programmatically change the application icon.
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | ---
14 |
15 |
16 |
Supported Platforms
17 |
18 |
19 |
20 |
21 |
22 | yarn add react-native-change-icon
23 |
24 | npm i react-native-change-icon
25 |
26 |
27 |
28 | ---
29 |
30 |
31 |
How to Use
32 |
33 |
34 | ---
35 |
36 |
37 |
1.
38 | Make your Icons
39 |
40 |
41 | I'd suggest exporting them around `1024px` or higher.
42 |
43 |
44 |
45 |
46 |
50 |
51 | ---
52 |
53 |
54 |
2.
55 | Generate Icons
56 |
57 |
58 | Use a service such as https://www.appicon.co/ in order to generate the platform specific icon files.
59 |
60 |
61 |
62 | - Just upload your images from earlier, and checkmark both `iPhone` and `Android`.
63 | - This will give you a `.zip` file with the files needed.
64 |
65 |
66 |

67 |
68 |
69 | ---
70 |
71 |
72 |
3.
73 | Prepare Icon Files
74 |
75 |
76 |
77 | - You need to rename and sort these files slightly differently for both `iOS` and `Android`.
78 |
79 | **Android 🤖**
80 | 1. Simply just rename them to something appropriate - typically this follows the naming convention `ic_launcher_.png` e.g. `ic_launcher_dark.png`
81 | - Make sure to keep them within the folder structure they are in `mipmap-hdpi`... etc.
82 | 2. Create a single `android` directory with all the `mipmap-*` directories inside. Inside them place all your generated icons.
83 |
84 |
88 |
89 | **iOS 🍏**
90 | 1. You will need the generated folder called `AppIcon.appiconset` as this contains your icons.
91 | 2. Rename this folder a bit like above for Android using a naming convention such as `.appiconset` e.g. `Dark.appiconset`
92 | 3. You will also need to edit the `Contents.json` to change and references from `Assets.xcassets/AppIcon.appiconset` to what you have renamed the file now e.g. `Images.xcassets/AppIcon.appiconset`
93 |
94 |
98 |
99 | ---
100 |
101 |
102 |
4.
103 | Import the Icons
104 |
105 |
106 |
107 | **Android 🤖**
108 | 1. Drag all of the `mipmap` folders into `android/app/src/main/res/`
109 |
110 | **iOS 🍏**
111 | 1. Drag all of the `.appiconset` folders into `ios//Images.xcassets`
112 |
113 |
114 |

115 |
116 |
117 | ---
118 |
119 |
120 |
5.
121 | Setup Environments
122 |
123 |
124 |
125 | **Android 🤖**
126 | 1. Add an alias for each of your new icons within the `AndroidManifest.xml` (within ``).
127 | - Make sure these have the properties as shown below.
128 | - Create an alias for `.MainActivityDefault` as well but for this, set `android:enabled="true"`.
129 | - For the name prefix it `.MainActivity...` followed by the name you will use to reference your icon. e.g. for our light icon we will use `.MainActivityLight`
130 | 2. You'll have to remove the `LAUNCHER` intent filter from the main `` as we have added the launcher in `.MainActivityDefault`.
131 |
132 |
133 |
136 |
137 | ```xml
138 |
144 |
145 |
146 |
147 |
148 |
149 | ```
150 |
151 | **iOS 🍏**
152 | 1. At the bottom of your `Info.plist` insert a key for `CFBundleIcons`
153 | - Note: For iPad, you need to add the key `CFBundleIcons~ipad`
154 | 2. Within this dictionary add another key for `CFBundleAlternateIcons`
155 | 3. Finally then within this dictionary you can add in the keys for you new icons
156 | - The `key` is the name you will reference from within code.
157 | - Set the first array item to the name of the `.appiconset` we created earlier.
158 | 4. In XCode, in your app's `General` settings, under `App Icons and Launch Screen`, set "App Icon" to `Default` and check the "Include all app icon assets" checkbox below.
159 |
160 |
161 |

162 |
163 |
166 |
167 | ```xml
168 | Dark
169 |
170 | CFBundleIconFiles
171 |
172 | Dark
173 |
174 | UIPrerenderedIcon
175 |
176 |
177 | ```
178 |
179 | ---
180 |
181 |
182 |
6.
183 | Use the Icons
184 |
185 |
186 | You can now use your icons and switch between them within React Native 🎉
187 |
188 |
189 |
190 |
191 | ```javascript
192 | import { changeIcon, getIcon, resetIcon } from 'react-native-change-icon';
193 |
194 | // Pass the name of icon to be enabled
195 | changeIcon('Dark');
196 | changeIcon('Light');
197 |
198 | // Get the icon currently enabled
199 | getIcon();
200 |
201 | // Reset the Icon to the default
202 | resetIcon();
203 | ```
204 |
205 | > All functions are typed and return a promise that either resolves successfully, or will reject with the error that has occurred.
206 |
207 | **react-native-push-notification and notifee**
208 |
209 | When using `react-native-push-notification` or `notifee`, notifications won't work as we are using `activity-alias`.
210 |
211 | To fix this, you need to create a Java file for each of the `activity-alias` in your `AndroidManifest.xml`.
212 |
213 | The file should be placed alongside you `MainActivity.java`. Example:
214 | ```
215 | android/app/src/main/java/com/myapp/MainActivity.java
216 | ```
217 | The content of this file should be:
218 | ```
219 | package com.myapp;
220 | public class MainActivity extends MainActivity {}
221 | ```
222 | Replace `` with the icon name used in the manifest. Replace com.myapp with your android app structure.
223 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 |
7 | dependencies {
8 | classpath "com.android.tools.build:gradle:7.2.1"
9 | }
10 | }
11 |
12 | def isNewArchitectureEnabled() {
13 | return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
14 | }
15 |
16 | apply plugin: "com.android.library"
17 |
18 |
19 | def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
20 |
21 | if (isNewArchitectureEnabled()) {
22 | apply plugin: "com.facebook.react"
23 | }
24 |
25 | def getExtOrDefault(name) {
26 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["ChangeIcon_" + name]
27 | }
28 |
29 | def getExtOrIntegerDefault(name) {
30 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ChangeIcon_" + name]).toInteger()
31 | }
32 |
33 | def supportsNamespace() {
34 | def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
35 | def major = parsed[0].toInteger()
36 | def minor = parsed[1].toInteger()
37 |
38 | // Namespace support was added in 7.3.0
39 | if (major == 7 && minor >= 3) {
40 | return true
41 | }
42 |
43 | return major >= 8
44 | }
45 |
46 | android {
47 | if (supportsNamespace()) {
48 | namespace "com.reactnativechangeicon"
49 |
50 | sourceSets {
51 | main {
52 | manifest.srcFile "src/main/AndroidManifestNew.xml"
53 | }
54 | }
55 | }
56 |
57 | compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
58 |
59 | defaultConfig {
60 | minSdkVersion getExtOrIntegerDefault("minSdkVersion")
61 | targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
62 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
63 | }
64 | buildTypes {
65 | release {
66 | minifyEnabled false
67 | }
68 | }
69 |
70 | lintOptions {
71 | disable "GradleCompatible"
72 | }
73 |
74 | compileOptions {
75 | sourceCompatibility JavaVersion.VERSION_1_8
76 | targetCompatibility JavaVersion.VERSION_1_8
77 | }
78 |
79 | }
80 |
81 | repositories {
82 | mavenCentral()
83 | google()
84 | }
85 |
86 |
87 | dependencies {
88 | // For < 0.71, this will be from the local maven repo
89 | // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
90 | //noinspection GradleDynamicVersion
91 | implementation "com.facebook.react:react-native:+"
92 | }
93 |
94 | if (isNewArchitectureEnabled()) {
95 | react {
96 | jsRootDir = file("../src/")
97 | libraryName = "ChangeIcon"
98 | codegenJavaPackageName = "com.reactnativechangeicon"
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | ChangeIcon_kotlinVersion=1.7.0
2 | ChangeIcon_minSdkVersion=21
3 | ChangeIcon_targetSdkVersion=31
4 | ChangeIcon_compileSdkVersion=31
5 | ChangeIcon_ndkversion=21.4.7075529
6 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifestNew.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/android/src/main/java/com/reactnativechangeicon/ChangeIconModule.java:
--------------------------------------------------------------------------------
1 | package com.reactnativechangeicon;
2 |
3 | import androidx.annotation.NonNull;
4 |
5 | import android.app.Activity;
6 | import android.app.Application;
7 | import android.content.pm.PackageManager;
8 | import android.content.ComponentName;
9 | import android.os.Bundle;
10 |
11 | import com.facebook.react.bridge.Promise;
12 | import com.facebook.react.bridge.ReactApplicationContext;
13 | import com.facebook.react.bridge.ReactContextBaseJavaModule;
14 | import com.facebook.react.bridge.ReactMethod;
15 | import com.facebook.react.module.annotations.ReactModule;
16 |
17 | import java.util.HashSet;
18 | import java.util.Set;
19 |
20 | @ReactModule(name = "ChangeIcon")
21 | public class ChangeIconModule extends ReactContextBaseJavaModule implements Application.ActivityLifecycleCallbacks {
22 | public static final String NAME = "ChangeIcon";
23 | private final String packageName;
24 | private final Set classesToKill = new HashSet<>();
25 | private Boolean iconChanged = false;
26 | private String componentClass = "";
27 |
28 | public ChangeIconModule(ReactApplicationContext reactContext, String packageName) {
29 | super(reactContext);
30 | this.packageName = packageName;
31 | }
32 |
33 | @Override
34 | @NonNull
35 | public String getName() {
36 | return NAME;
37 | }
38 |
39 | @ReactMethod
40 | public void getIcon(Promise promise) {
41 | final Activity activity = getCurrentActivity();
42 | if (activity == null) {
43 | promise.reject("ANDROID:ACTIVITY_NOT_FOUND");
44 | return;
45 | }
46 |
47 | final String activityName = activity.getComponentName().getClassName();
48 |
49 | if (activityName.endsWith("MainActivity")) {
50 | promise.resolve("Default");
51 | return;
52 | }
53 | String[] activityNameSplit = activityName.split("MainActivity");
54 | if (activityNameSplit.length != 2) {
55 | promise.reject("ANDROID:UNEXPECTED_COMPONENT_CLASS:" + this.componentClass);
56 | return;
57 | }
58 | promise.resolve(activityNameSplit[1]);
59 | return;
60 | }
61 |
62 | @ReactMethod
63 | public void changeIcon(String iconName, Promise promise) {
64 | final Activity activity = getCurrentActivity();
65 | final String activityName = activity.getComponentName().getClassName();
66 | if (activity == null) {
67 | promise.reject("ANDROID:ACTIVITY_NOT_FOUND");
68 | return;
69 | }
70 | if (this.componentClass.isEmpty()) {
71 | this.componentClass = activityName.endsWith("MainActivity") ? activityName + "Default" : activityName;
72 | }
73 |
74 | final String newIconName = (iconName == null || iconName.isEmpty()) ? "Default" : iconName;
75 | final String activeClass = this.packageName + ".MainActivity" + newIconName;
76 | if (this.componentClass.equals(activeClass)) {
77 | promise.reject("ANDROID:ICON_ALREADY_USED:" + this.componentClass);
78 | return;
79 | }
80 | try {
81 | activity.getPackageManager().setComponentEnabledSetting(
82 | new ComponentName(this.packageName, activeClass),
83 | PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
84 | PackageManager.DONT_KILL_APP);
85 | promise.resolve(newIconName);
86 | } catch (Exception e) {
87 | promise.reject("ANDROID:ICON_INVALID");
88 | return;
89 | }
90 | this.classesToKill.add(this.componentClass);
91 | this.componentClass = activeClass;
92 | activity.getApplication().registerActivityLifecycleCallbacks(this);
93 | iconChanged = true;
94 | }
95 |
96 | private void completeIconChange() {
97 | if (!iconChanged)
98 | return;
99 | final Activity activity = getCurrentActivity();
100 | if (activity == null)
101 | return;
102 |
103 | classesToKill.remove(componentClass);
104 | classesToKill.forEach((cls) -> activity.getPackageManager().setComponentEnabledSetting(
105 | new ComponentName(this.packageName, cls),
106 | PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
107 | PackageManager.DONT_KILL_APP));
108 | classesToKill.clear();
109 | iconChanged = false;
110 | }
111 |
112 | @Override
113 | public void onActivityPaused(Activity activity) {
114 | completeIconChange();
115 | }
116 |
117 | @Override
118 | public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
119 | }
120 |
121 | @Override
122 | public void onActivityStarted(Activity activity) {
123 | }
124 |
125 | @Override
126 | public void onActivityResumed(Activity activity) {
127 | }
128 |
129 | @Override
130 | public void onActivityStopped(Activity activity) {
131 | }
132 |
133 | @Override
134 | public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
135 | }
136 |
137 | @Override
138 | public void onActivityDestroyed(Activity activity) {
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/android/src/main/java/com/reactnativechangeicon/ChangeIconPackage.java:
--------------------------------------------------------------------------------
1 | package com.reactnativechangeicon;
2 |
3 | import androidx.annotation.NonNull;
4 |
5 | import com.facebook.react.ReactPackage;
6 | import com.facebook.react.bridge.NativeModule;
7 | import com.facebook.react.bridge.ReactApplicationContext;
8 | import com.facebook.react.uimanager.ViewManager;
9 |
10 | import java.util.ArrayList;
11 | import java.util.Collections;
12 | import java.util.List;
13 |
14 | public class ChangeIconPackage implements ReactPackage {
15 | private final String packageName;
16 |
17 | public ChangeIconPackage(String packageName) {
18 | this.packageName = packageName;
19 | }
20 |
21 | @NonNull
22 | @Override
23 | public List createNativeModules(@NonNull ReactApplicationContext reactContext) {
24 | List modules = new ArrayList<>();
25 | modules.add(new ChangeIconModule(reactContext, this.packageName));
26 | return modules;
27 | }
28 |
29 | @NonNull
30 | @Override
31 | public List createViewManagers(@NonNull ReactApplicationContext reactContext) {
32 | return Collections.emptyList();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/dist/index.d.ts:
--------------------------------------------------------------------------------
1 | export declare const changeIcon: (iconName?: string) => Promise;
2 | export declare const resetIcon: () => Promise;
3 | export declare const getIcon: () => Promise;
4 |
--------------------------------------------------------------------------------
/dist/index.js:
--------------------------------------------------------------------------------
1 | import { NativeModules } from "react-native";
2 | export const changeIcon = (iconName) => NativeModules.ChangeIcon.changeIcon(iconName);
3 | export const resetIcon = () => changeIcon();
4 | export const getIcon = () => NativeModules.ChangeIcon.getIcon();
5 |
--------------------------------------------------------------------------------
/docs/examples/Step-1/Icon - Dark.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-1/Icon - Dark.jpg
--------------------------------------------------------------------------------
/docs/examples/Step-1/Icon - Default.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-1/Icon - Default.jpg
--------------------------------------------------------------------------------
/docs/examples/Step-1/Icon - Light.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-1/Icon - Light.jpg
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-hdpi/ic_launcher_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-hdpi/ic_launcher_dark.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-hdpi/ic_launcher_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-hdpi/ic_launcher_light.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-mdpi/ic_launcher_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-mdpi/ic_launcher_dark.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-mdpi/ic_launcher_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-mdpi/ic_launcher_light.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-xhdpi/ic_launcher_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-xhdpi/ic_launcher_dark.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-xhdpi/ic_launcher_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-xhdpi/ic_launcher_light.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-xxhdpi/ic_launcher_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-xxhdpi/ic_launcher_dark.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-xxhdpi/ic_launcher_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-xxhdpi/ic_launcher_light.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-xxxhdpi/ic_launcher_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-xxxhdpi/ic_launcher_dark.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/android/mipmap-xxxhdpi/ic_launcher_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/android/mipmap-xxxhdpi/ic_launcher_light.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/1024.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/114.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/120.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/180.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/29.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/40.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/57.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/58.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/60.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/80.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Dark.appiconset/87.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Dark.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Images.xcassets/Dark.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Images.xcassets/Dark.appiconset/","scale":"1x"}]}
2 |
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/1024.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/114.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/120.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/180.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/29.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/40.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/57.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/58.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/60.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/80.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Default.appiconset/87.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Default.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Images.xcassets/Default.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Images.xcassets/Default.appiconset/","scale":"1x"}]}
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/1024.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/114.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/120.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/180.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/29.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/40.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/57.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/58.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/60.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/80.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/examples/Step-3/ios/Light.appiconset/87.png
--------------------------------------------------------------------------------
/docs/examples/Step-3/ios/Light.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Images.xcassets/Light.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Images.xcassets/Light.appiconset/","scale":"1x"}]}
2 |
--------------------------------------------------------------------------------
/docs/examples/Step-4/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
17 |
18 |
19 |
20 |
21 |
22 |
28 |
29 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/docs/examples/Step-4/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | MyApp
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(MARKETING_VERSION)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | UILaunchStoryboardName
24 | LaunchScreen.storyboard
25 |
26 | CFBundleIcons
27 |
28 | CFBundleAlternateIcons
29 |
30 | Dark
31 |
32 | CFBundleIconFiles
33 |
34 | AppIconDark
35 |
36 | UIPrerenderedIcon
37 |
38 |
39 | Light
40 |
41 | UIPrerenderedIcon
42 |
43 | CFBundleIconFiles
44 |
45 | AppIconLight
46 |
47 |
48 |
49 | CFBundlePrimaryIcon
50 |
51 | CFBundleIconName
52 |
53 | CFBundleIconFiles
54 |
55 | AppIcon
56 |
57 | UIPrerenderedIcon
58 |
59 |
60 | UINewsstandIcon
61 |
62 | CFBundleIconFiles
63 |
64 | AppIcon
65 |
66 | UINewsstandBindingType
67 | UINewsstandBindingTypeMagazine
68 | UINewsstandBindingEdge
69 | UINewsstandBindingEdgeLeft
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/docs/images/icons-example-exported-android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/images/icons-example-exported-android.png
--------------------------------------------------------------------------------
/docs/images/icons-example-exported.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/images/icons-example-exported.png
--------------------------------------------------------------------------------
/docs/images/icons-examples-dir.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/images/icons-examples-dir.png
--------------------------------------------------------------------------------
/docs/images/icons-examples-generate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/images/icons-examples-generate.png
--------------------------------------------------------------------------------
/docs/images/icons-examples-showcase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/images/icons-examples-showcase.png
--------------------------------------------------------------------------------
/docs/ios-example-app-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skb1129/react-native-change-icon/6f2b68ecd38eb7cb76de520698ecbb241780c87d/docs/ios-example-app-icon.png
--------------------------------------------------------------------------------
/ios/ChangeIcon.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #ifdef RCT_NEW_ARCH_ENABLED
4 | #import "RNChangeIconSpec.h"
5 | @interface ChangeIcon : NSObject
6 | #else
7 | #import
8 | @interface ChangeIcon : NSObject
9 | #endif
10 |
11 | @end
12 |
--------------------------------------------------------------------------------
/ios/ChangeIcon.mm:
--------------------------------------------------------------------------------
1 | #import "ChangeIcon.h"
2 |
3 | @implementation ChangeIcon
4 | RCT_EXPORT_MODULE()
5 |
6 | + (BOOL)requiresMainQueueSetup {
7 | return NO;
8 | }
9 |
10 | RCT_REMAP_METHOD(getIcon, resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
11 | dispatch_async(dispatch_get_main_queue(), ^{
12 | NSString *currentIcon = [[UIApplication sharedApplication] alternateIconName];
13 | if (currentIcon) {
14 | resolve(currentIcon);
15 | } else {
16 | resolve(@"Default");
17 | }
18 | });
19 | }
20 |
21 | RCT_REMAP_METHOD(changeIcon, iconName:(NSString *)iconName resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
22 | dispatch_async(dispatch_get_main_queue(), ^{
23 | NSError *error = nil;
24 |
25 | if ([[UIApplication sharedApplication] supportsAlternateIcons] == NO) {
26 | reject(@"Error", @"IOS:NOT_SUPPORTED", error);
27 | return;
28 | }
29 |
30 | NSString *currentIcon = [[UIApplication sharedApplication] alternateIconName];
31 |
32 | if ([iconName isEqualToString:currentIcon]) {
33 | reject(@"Error", @"IOS:ICON_ALREADY_USED", error);
34 | return;
35 | }
36 |
37 | NSString *newIconName;
38 | if (iconName == nil || [iconName length] == 0 || [iconName isEqualToString:@"Default"]) {
39 | newIconName = nil;
40 | resolve(@"Default");
41 | } else {
42 | newIconName = iconName;
43 | resolve(newIconName);
44 | }
45 |
46 | [[UIApplication sharedApplication] setAlternateIconName:newIconName completionHandler:^(NSError * _Nullable error) {
47 | return;
48 | }];
49 | });
50 | }
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/ios/ChangeIcon.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 5E555C0D2413F4C50049A1A2 /* ChangeIcon.mm in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* ChangeIcon.mm */; };
11 | /* End PBXBuildFile section */
12 |
13 | /* Begin PBXCopyFilesBuildPhase section */
14 | 58B511D91A9E6C8500147676 /* CopyFiles */ = {
15 | isa = PBXCopyFilesBuildPhase;
16 | buildActionMask = 2147483647;
17 | dstPath = "include/$(PRODUCT_NAME)";
18 | dstSubfolderSpec = 16;
19 | files = (
20 | );
21 | runOnlyForDeploymentPostprocessing = 0;
22 | };
23 | /* End PBXCopyFilesBuildPhase section */
24 |
25 | /* Begin PBXFileReference section */
26 | 134814201AA4EA6300B7C361 /* libChangeIcon.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libChangeIcon.a; sourceTree = BUILT_PRODUCTS_DIR; };
27 | B3E7B5881CC2AC0600A0062D /* ChangeIcon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChangeIcon.h; sourceTree = ""; };
28 | B3E7B5891CC2AC0600A0062D /* ChangeIcon.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChangeIcon.mm; sourceTree = ""; };
29 | /* End PBXFileReference section */
30 |
31 | /* Begin PBXFrameworksBuildPhase section */
32 | 58B511D81A9E6C8500147676 /* Frameworks */ = {
33 | isa = PBXFrameworksBuildPhase;
34 | buildActionMask = 2147483647;
35 | files = (
36 | );
37 | runOnlyForDeploymentPostprocessing = 0;
38 | };
39 | /* End PBXFrameworksBuildPhase section */
40 |
41 | /* Begin PBXGroup section */
42 | 134814211AA4EA7D00B7C361 /* Products */ = {
43 | isa = PBXGroup;
44 | children = (
45 | 134814201AA4EA6300B7C361 /* libChangeIcon.a */,
46 | );
47 | name = Products;
48 | sourceTree = "";
49 | };
50 | 58B511D21A9E6C8500147676 = {
51 | isa = PBXGroup;
52 | children = (
53 | B3E7B5881CC2AC0600A0062D /* ChangeIcon.h */,
54 | B3E7B5891CC2AC0600A0062D /* ChangeIcon.mm */,
55 | 134814211AA4EA7D00B7C361 /* Products */,
56 | );
57 | sourceTree = "";
58 | };
59 | /* End PBXGroup section */
60 |
61 | /* Begin PBXNativeTarget section */
62 | 58B511DA1A9E6C8500147676 /* ChangeIcon */ = {
63 | isa = PBXNativeTarget;
64 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "ChangeIcon" */;
65 | buildPhases = (
66 | 58B511D71A9E6C8500147676 /* Sources */,
67 | 58B511D81A9E6C8500147676 /* Frameworks */,
68 | 58B511D91A9E6C8500147676 /* CopyFiles */,
69 | );
70 | buildRules = (
71 | );
72 | dependencies = (
73 | );
74 | name = ChangeIcon;
75 | productName = RCTDataManager;
76 | productReference = 134814201AA4EA6300B7C361 /* libChangeIcon.a */;
77 | productType = "com.apple.product-type.library.static";
78 | };
79 | /* End PBXNativeTarget section */
80 |
81 | /* Begin PBXProject section */
82 | 58B511D31A9E6C8500147676 /* Project object */ = {
83 | isa = PBXProject;
84 | attributes = {
85 | LastUpgradeCheck = 0920;
86 | ORGANIZATIONNAME = Facebook;
87 | TargetAttributes = {
88 | 58B511DA1A9E6C8500147676 = {
89 | CreatedOnToolsVersion = 6.1.1;
90 | };
91 | };
92 | };
93 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "ChangeIcon" */;
94 | compatibilityVersion = "Xcode 3.2";
95 | developmentRegion = English;
96 | hasScannedForEncodings = 0;
97 | knownRegions = (
98 | English,
99 | en,
100 | );
101 | mainGroup = 58B511D21A9E6C8500147676;
102 | productRefGroup = 58B511D21A9E6C8500147676;
103 | projectDirPath = "";
104 | projectRoot = "";
105 | targets = (
106 | 58B511DA1A9E6C8500147676 /* ChangeIcon */,
107 | );
108 | };
109 | /* End PBXProject section */
110 |
111 | /* Begin PBXSourcesBuildPhase section */
112 | 58B511D71A9E6C8500147676 /* Sources */ = {
113 | isa = PBXSourcesBuildPhase;
114 | buildActionMask = 2147483647;
115 | files = (
116 | B3E7B58A1CC2AC0600A0062D /* ChangeIcon.mm in Sources */,
117 | );
118 | runOnlyForDeploymentPostprocessing = 0;
119 | };
120 | /* End PBXSourcesBuildPhase section */
121 |
122 | /* Begin XCBuildConfiguration section */
123 | 58B511ED1A9E6C8500147676 /* Debug */ = {
124 | isa = XCBuildConfiguration;
125 | buildSettings = {
126 | ALWAYS_SEARCH_USER_PATHS = NO;
127 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
128 | CLANG_CXX_LIBRARY = "libc++";
129 | CLANG_ENABLE_MODULES = YES;
130 | CLANG_ENABLE_OBJC_ARC = YES;
131 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
132 | CLANG_WARN_BOOL_CONVERSION = YES;
133 | CLANG_WARN_COMMA = YES;
134 | CLANG_WARN_CONSTANT_CONVERSION = YES;
135 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
136 | CLANG_WARN_EMPTY_BODY = YES;
137 | CLANG_WARN_ENUM_CONVERSION = YES;
138 | CLANG_WARN_INFINITE_RECURSION = YES;
139 | CLANG_WARN_INT_CONVERSION = YES;
140 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
141 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
142 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
143 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
144 | CLANG_WARN_STRICT_PROTOTYPES = YES;
145 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
146 | CLANG_WARN_UNREACHABLE_CODE = YES;
147 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
148 | COPY_PHASE_STRIP = NO;
149 | ENABLE_STRICT_OBJC_MSGSEND = YES;
150 | ENABLE_TESTABILITY = YES;
151 | "EXCLUDED_ARCHS[sdk=*]" = arm64;
152 | GCC_C_LANGUAGE_STANDARD = gnu99;
153 | GCC_DYNAMIC_NO_PIC = NO;
154 | GCC_NO_COMMON_BLOCKS = YES;
155 | GCC_OPTIMIZATION_LEVEL = 0;
156 | GCC_PREPROCESSOR_DEFINITIONS = (
157 | "DEBUG=1",
158 | "$(inherited)",
159 | );
160 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
161 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
162 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
163 | GCC_WARN_UNDECLARED_SELECTOR = YES;
164 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
165 | GCC_WARN_UNUSED_FUNCTION = YES;
166 | GCC_WARN_UNUSED_VARIABLE = YES;
167 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
168 | MTL_ENABLE_DEBUG_INFO = YES;
169 | ONLY_ACTIVE_ARCH = YES;
170 | SDKROOT = iphoneos;
171 | };
172 | name = Debug;
173 | };
174 | 58B511EE1A9E6C8500147676 /* Release */ = {
175 | isa = XCBuildConfiguration;
176 | buildSettings = {
177 | ALWAYS_SEARCH_USER_PATHS = NO;
178 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
179 | CLANG_CXX_LIBRARY = "libc++";
180 | CLANG_ENABLE_MODULES = YES;
181 | CLANG_ENABLE_OBJC_ARC = YES;
182 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
183 | CLANG_WARN_BOOL_CONVERSION = YES;
184 | CLANG_WARN_COMMA = YES;
185 | CLANG_WARN_CONSTANT_CONVERSION = YES;
186 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
187 | CLANG_WARN_EMPTY_BODY = YES;
188 | CLANG_WARN_ENUM_CONVERSION = YES;
189 | CLANG_WARN_INFINITE_RECURSION = YES;
190 | CLANG_WARN_INT_CONVERSION = YES;
191 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
192 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
193 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
194 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
195 | CLANG_WARN_STRICT_PROTOTYPES = YES;
196 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
197 | CLANG_WARN_UNREACHABLE_CODE = YES;
198 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
199 | COPY_PHASE_STRIP = YES;
200 | ENABLE_NS_ASSERTIONS = NO;
201 | ENABLE_STRICT_OBJC_MSGSEND = YES;
202 | "EXCLUDED_ARCHS[sdk=*]" = arm64;
203 | GCC_C_LANGUAGE_STANDARD = gnu99;
204 | GCC_NO_COMMON_BLOCKS = YES;
205 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
206 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
207 | GCC_WARN_UNDECLARED_SELECTOR = YES;
208 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
209 | GCC_WARN_UNUSED_FUNCTION = YES;
210 | GCC_WARN_UNUSED_VARIABLE = YES;
211 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
212 | MTL_ENABLE_DEBUG_INFO = NO;
213 | SDKROOT = iphoneos;
214 | VALIDATE_PRODUCT = YES;
215 | };
216 | name = Release;
217 | };
218 | 58B511F01A9E6C8500147676 /* Debug */ = {
219 | isa = XCBuildConfiguration;
220 | buildSettings = {
221 | HEADER_SEARCH_PATHS = (
222 | "$(inherited)",
223 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
224 | "$(SRCROOT)/../../../React/**",
225 | "$(SRCROOT)/../../react-native/React/**",
226 | );
227 | LIBRARY_SEARCH_PATHS = "$(inherited)";
228 | OTHER_LDFLAGS = "-ObjC";
229 | PRODUCT_NAME = ChangeIcon;
230 | SKIP_INSTALL = YES;
231 | };
232 | name = Debug;
233 | };
234 | 58B511F11A9E6C8500147676 /* Release */ = {
235 | isa = XCBuildConfiguration;
236 | buildSettings = {
237 | HEADER_SEARCH_PATHS = (
238 | "$(inherited)",
239 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
240 | "$(SRCROOT)/../../../React/**",
241 | "$(SRCROOT)/../../react-native/React/**",
242 | );
243 | LIBRARY_SEARCH_PATHS = "$(inherited)";
244 | OTHER_LDFLAGS = "-ObjC";
245 | PRODUCT_NAME = ChangeIcon;
246 | SKIP_INSTALL = YES;
247 | };
248 | name = Release;
249 | };
250 | /* End XCBuildConfiguration section */
251 |
252 | /* Begin XCConfigurationList section */
253 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "ChangeIcon" */ = {
254 | isa = XCConfigurationList;
255 | buildConfigurations = (
256 | 58B511ED1A9E6C8500147676 /* Debug */,
257 | 58B511EE1A9E6C8500147676 /* Release */,
258 | );
259 | defaultConfigurationIsVisible = 0;
260 | defaultConfigurationName = Release;
261 | };
262 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "ChangeIcon" */ = {
263 | isa = XCConfigurationList;
264 | buildConfigurations = (
265 | 58B511F01A9E6C8500147676 /* Debug */,
266 | 58B511F11A9E6C8500147676 /* Release */,
267 | );
268 | defaultConfigurationIsVisible = 0;
269 | defaultConfigurationName = Release;
270 | };
271 | /* End XCConfigurationList section */
272 | };
273 | rootObject = 58B511D31A9E6C8500147676 /* Project object */;
274 | }
275 |
--------------------------------------------------------------------------------
/ios/ChangeIcon.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-change-icon",
3 | "title": "React Native Change Icon",
4 | "version": "5.0.0",
5 | "description": "Change application icon programmatically in React-Native.",
6 | "main": "dist/index.js",
7 | "source": "src/index.ts",
8 | "react-native": "dist/index.js",
9 | "types": "dist/index.d.ts",
10 | "files": [
11 | "android",
12 | "ios",
13 | "dist/**/*",
14 | "NativeChangeIcon.ts",
15 | "react-native-change-icon.podspec",
16 | "react-native.config.js",
17 | "README.md"
18 | ],
19 | "scripts": {
20 | "build": "tsc"
21 | },
22 | "keywords": [
23 | "react-native",
24 | "ios",
25 | "android"
26 | ],
27 | "repository": "https://github.com/skb1129/react-native-change-icon",
28 | "author": "Surya Kant Bansal (https://github.com/skb1129)",
29 | "license": "MIT",
30 | "bugs": {
31 | "url": "https://github.com/skb1129/react-native-change-icon/issues"
32 | },
33 | "homepage": "https://github.com/skb1129/react-native-change-icon#readme",
34 | "publishConfig": {
35 | "registry": "https://registry.npmjs.org/"
36 | },
37 | "devDependencies": {
38 | "react-native": "^0.72.4",
39 | "@types/react-native": "^0.72.2",
40 | "typescript": "^5.1.6"
41 | },
42 | "peerDependencies": {
43 | "react-native": "*"
44 | },
45 | "packageManager": "^yarn@1.22.19",
46 | "codegenConfig": {
47 | "name": "RNChangeIconSpec",
48 | "type": "all",
49 | "jsSrcsDir": ".",
50 | "android": {
51 | "javaPackageName": "com.facebook.fbreact.specs"
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/react-native-change-icon.podspec:
--------------------------------------------------------------------------------
1 | require "json"
2 |
3 | package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4 | folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5 |
6 | Pod::Spec.new do |s|
7 | s.name = "react-native-change-icon"
8 | s.version = package["version"]
9 | s.summary = package["description"]
10 | s.homepage = package["homepage"]
11 | s.license = package["license"]
12 | s.authors = package["author"]
13 |
14 | s.platforms = { :ios => "12.0" }
15 | s.source = { :git => "https://github.com/skb1129/react-native-change-icon.git", :tag => "#{s.version}" }
16 |
17 | s.source_files = "ios/**/*.{h,m,mm}"
18 |
19 | # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
20 | # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
21 | if respond_to?(:install_modules_dependencies, true)
22 | install_modules_dependencies(s)
23 | else
24 | s.dependency "React-Core"
25 |
26 | # Don't install the dependencies when we run `pod install` in the old architecture.
27 | if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
28 | s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
29 | s.pod_target_xcconfig = {
30 | "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
31 | "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
32 | "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
33 | }
34 | s.dependency "React-Codegen"
35 | s.dependency "RCT-Folly"
36 | s.dependency "RCTRequired"
37 | s.dependency "RCTTypeSafety"
38 | s.dependency "ReactCommon/turbomodule/core"
39 | end
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/react-native.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | dependency: {
3 | platforms: {
4 | android: {
5 | packageInstance: "new ChangeIconPackage(BuildConfig.APPLICATION_ID)",
6 | },
7 | },
8 | },
9 | };
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | import { NativeModules } from "react-native";
2 |
3 | export const changeIcon = (iconName?: string): Promise => NativeModules.ChangeIcon.changeIcon(iconName);
4 | export const resetIcon = () => changeIcon();
5 | export const getIcon = (): Promise => NativeModules.ChangeIcon.getIcon();
6 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": "./",
4 | "paths": {
5 | "react-native-change-icon": ["./src/index"]
6 | },
7 | "allowUnreachableCode": false,
8 | "allowUnusedLabels": false,
9 | "declaration": true,
10 | "esModuleInterop": true,
11 | "forceConsistentCasingInFileNames": true,
12 | "jsx": "react",
13 | "lib": ["esnext"],
14 | "module": "esnext",
15 | "moduleResolution": "node",
16 | "noFallthroughCasesInSwitch": true,
17 | "noImplicitReturns": true,
18 | "noImplicitUseStrict": false,
19 | "noStrictGenericChecks": false,
20 | "noUncheckedIndexedAccess": true,
21 | "noUnusedLocals": true,
22 | "noUnusedParameters": true,
23 | "outDir": "dist",
24 | "resolveJsonModule": true,
25 | "skipLibCheck": true,
26 | "strict": true,
27 | "target": "esnext",
28 | "verbatimModuleSyntax": true
29 | },
30 | "files": ["./src/index.ts"]
31 | }
32 |
--------------------------------------------------------------------------------