├── .gitignore ├── README.md ├── android ├── .classpath ├── .project ├── .settings │ └── org.eclipse.buildship.core.prefs ├── README.md ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── reactlibrary │ ├── SetAppIconModule.java │ └── SetAppIconPackage.java ├── docs ├── icons.png └── infoplist.png ├── index.d.ts ├── index.js ├── ios ├── SetAppIcon.h ├── SetAppIcon.m ├── SetAppIcon.xcodeproj │ └── project.pbxproj └── SetAppIcon.xcworkspace │ └── contents.xcworkspacedata ├── package.json ├── react-native-set-app-icon.podspec └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # node.js 6 | # 7 | node_modules/ 8 | npm-debug.log 9 | yarn-error.log 10 | 11 | # Xcode 12 | # 13 | build/ 14 | *.pbxuser 15 | !default.pbxuser 16 | *.mode1v3 17 | !default.mode1v3 18 | *.mode2v3 19 | !default.mode2v3 20 | *.perspectivev3 21 | !default.perspectivev3 22 | xcuserdata 23 | *.xccheckout 24 | *.moved-aside 25 | DerivedData 26 | *.hmap 27 | *.ipa 28 | *.xcuserstate 29 | project.xcworkspace 30 | 31 | # Android/IntelliJ 32 | # 33 | build/ 34 | .idea 35 | .gradle 36 | local.properties 37 | *.iml 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![appicon](https://github.com/user-attachments/assets/b30fd7ba-6e19-41a3-9c6f-4093606364a2) 2 | 3 | ### About 4 | App & Flow is a Montreal-based React Native engineering and consulting studio. We partner with the world’s top companies and are recommended by [Expo](https://expo.dev/consultants). Need a hand? Let’s build together. team@appandflow.com 5 | 6 | Let your users dynamically change their app icons directly from within the app. 7 | 8 | ## ANDROID IN PROGRESS 9 | 10 | ## Getting started 11 | 12 | `$ npm install react-native-set-app-icon --save` 13 | 14 | ### Mostly automatic installation 15 | 16 | `$ react-native link react-native-set-app-icon` 17 | 18 | ## IOS 19 | 20 | Setup XCode 21 | 22 | Put all your images as `@2x.png` `@3x.png` in the root of your project setup. 23 | 24 | ![](docs/icons.png) 25 | 26 | Once that's done, go to `Info.plist` and follow this setup : 27 | 28 | ![](docs/infoplist.png) 29 | 30 | ## Usage 31 | 32 | ```javascript 33 | import SetAppIcon from "react-native-set-app-icon"; 34 | ``` 35 | 36 | ### changeAppIcon 37 | 38 | Promise that returns a boolean. Takes the `iconName` name set in your config. 39 | 40 | ```js 41 | SetAppIcon.changeIcon(iconName: string): Promise; 42 | ``` 43 | 44 | If you want to set the default back just use `null`. 45 | 46 | ```js 47 | SetAppIcon.changeIcon(null); 48 | ``` 49 | 50 | ### getIconName 51 | 52 | Takes a callback and receives an object with `iconName` in it. 53 | 54 | ```js 55 | SetAppIcon.getIconName(cb: (icon: { iconName: string }) => void): void; 56 | ``` 57 | 58 | ### supportsDynamicAppIcon 59 | 60 | Returns a Promise with a boolean if the device accepts the dynamic app icon change. 61 | 62 | ```js 63 | SetAppIcon.supportsDynamicAppIcon(): Promise; 64 | ``` 65 | -------------------------------------------------------------------------------- /android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | arguments= 2 | auto.sync=false 3 | build.scans.enabled=false 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.3)) 5 | connection.project.dir= 6 | eclipse.preferences.version=1 7 | gradle.user.home= 8 | java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home 9 | jvm.arguments= 10 | offline.mode=false 11 | override.workspace.settings=true 12 | show.console.view=true 13 | show.executions.view=true 14 | -------------------------------------------------------------------------------- /android/README.md: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: 5 | 6 | 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed 7 | 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK 8 | ``` 9 | ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle 10 | sdk.dir=/Users/{username}/Library/Android/sdk 11 | ``` 12 | 3. Delete the `maven` folder 13 | 4. Run `./gradlew installArchives` 14 | 5. Verify that latest set of generated files is in the maven folder with the correct version number 15 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // android/build.gradle 2 | 3 | // based on: 4 | // 5 | // * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle 6 | // original location: 7 | // - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle 8 | // 9 | // * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle 10 | // original location: 11 | // - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle 12 | 13 | def DEFAULT_COMPILE_SDK_VERSION = 28 14 | def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' 15 | def DEFAULT_MIN_SDK_VERSION = 16 16 | def DEFAULT_TARGET_SDK_VERSION = 28 17 | 18 | def safeExtGet(prop, fallback) { 19 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | apply plugin: 'maven' 24 | 25 | buildscript { 26 | // The Android Gradle plugin is only required when opening the android folder stand-alone. 27 | // This avoids unnecessary downloads and potential conflicts when the library is included as a 28 | // module dependency in an application project. 29 | // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies 30 | if (project == rootProject) { 31 | repositories { 32 | google() 33 | jcenter() 34 | } 35 | dependencies { 36 | classpath 'com.android.tools.build:gradle:3.4.1' 37 | } 38 | } 39 | } 40 | 41 | apply plugin: 'com.android.library' 42 | apply plugin: 'maven' 43 | 44 | android { 45 | compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) 46 | buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) 47 | defaultConfig { 48 | minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) 49 | targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) 50 | versionCode 1 51 | versionName "1.0" 52 | } 53 | lintOptions { 54 | abortOnError false 55 | } 56 | } 57 | 58 | repositories { 59 | // ref: https://www.baeldung.com/maven-local-repository 60 | mavenLocal() 61 | maven { 62 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 63 | url "$rootDir/../node_modules/react-native/android" 64 | } 65 | maven { 66 | // Android JSC is installed from npm 67 | url "$rootDir/../node_modules/jsc-android/dist" 68 | } 69 | google() 70 | jcenter() 71 | } 72 | 73 | dependencies { 74 | //noinspection GradleDynamicVersion 75 | implementation 'com.facebook.react:react-native:+' // From node_modules 76 | } 77 | 78 | def configureReactNativePom(def pom) { 79 | def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) 80 | 81 | pom.project { 82 | name packageJson.title 83 | artifactId packageJson.name 84 | version = packageJson.version 85 | group = "com.reactlibrary" 86 | description packageJson.description 87 | url packageJson.repository.baseUrl 88 | 89 | licenses { 90 | license { 91 | name packageJson.license 92 | url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename 93 | distribution 'repo' 94 | } 95 | } 96 | 97 | developers { 98 | developer { 99 | id packageJson.author.username 100 | name packageJson.author.name 101 | } 102 | } 103 | } 104 | } 105 | 106 | afterEvaluate { project -> 107 | // some Gradle build hooks ref: 108 | // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html 109 | task androidJavadoc(type: Javadoc) { 110 | source = android.sourceSets.main.java.srcDirs 111 | classpath += files(android.bootClasspath) 112 | classpath += files(project.getConfigurations().getByName('compile').asList()) 113 | include '**/*.java' 114 | } 115 | 116 | task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { 117 | classifier = 'javadoc' 118 | from androidJavadoc.destinationDir 119 | } 120 | 121 | task androidSourcesJar(type: Jar) { 122 | classifier = 'sources' 123 | from android.sourceSets.main.java.srcDirs 124 | include '**/*.java' 125 | } 126 | 127 | android.libraryVariants.all { variant -> 128 | def name = variant.name.capitalize() 129 | def javaCompileTask = variant.javaCompileProvider.get() 130 | 131 | task "jar${name}"(type: Jar, dependsOn: javaCompileTask) { 132 | from javaCompileTask.destinationDir 133 | } 134 | } 135 | 136 | artifacts { 137 | archives androidSourcesJar 138 | archives androidJavadocJar 139 | } 140 | 141 | task installArchives(type: Upload) { 142 | configuration = configurations.archives 143 | repositories.mavenDeployer { 144 | // Deploy to react-native-event-bridge/maven, ready to publish to npm 145 | repository url: "file://${projectDir}/../android/maven" 146 | configureReactNativePom pom 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactlibrary/SetAppIconModule.java: -------------------------------------------------------------------------------- 1 | package com.reactlibrary; 2 | 3 | import com.facebook.react.bridge.ReactApplicationContext; 4 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 5 | import com.facebook.react.bridge.ReactMethod; 6 | import com.facebook.react.bridge.Callback; 7 | 8 | public class SetAppIconModule extends ReactContextBaseJavaModule { 9 | 10 | private final ReactApplicationContext reactContext; 11 | 12 | public SetAppIconModule(ReactApplicationContext reactContext) { 13 | super(reactContext); 14 | this.reactContext = reactContext; 15 | } 16 | 17 | @Override 18 | public String getName() { 19 | return "SetAppIcon"; 20 | } 21 | 22 | @ReactMethod 23 | public void sampleMethod(String stringArgument, int numberArgument, Callback callback) { 24 | // TODO: Implement some actually useful functionality 25 | callback.invoke("Received numberArgument: " + numberArgument + " stringArgument: " + stringArgument); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactlibrary/SetAppIconPackage.java: -------------------------------------------------------------------------------- 1 | package com.reactlibrary; 2 | 3 | import java.util.Arrays; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.bridge.NativeModule; 9 | import com.facebook.react.bridge.ReactApplicationContext; 10 | import com.facebook.react.uimanager.ViewManager; 11 | import com.facebook.react.bridge.JavaScriptModule; 12 | 13 | public class SetAppIconPackage implements ReactPackage { 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Arrays.asList(new SetAppIconModule(reactContext)); 17 | } 18 | 19 | @Override 20 | public List createViewManagers(ReactApplicationContext reactContext) { 21 | return Collections.emptyList(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppAndFlow/react-native-set-app-icon/0fe9d4ad8c7cff470a3459157937bf37e0454d6f/docs/icons.png -------------------------------------------------------------------------------- /docs/infoplist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppAndFlow/react-native-set-app-icon/0fe9d4ad8c7cff470a3459157937bf37e0454d6f/docs/infoplist.png -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | declare const SetAppIcon: { 2 | getIconName(cb: (icon: { iconName: string }) => void): void; 3 | changeIcon(iconName: string | null): Promise; 4 | supportsDynamicAppIcon(): Promise; 5 | }; 6 | 7 | export default SetAppIcon; 8 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules } from "react-native"; 2 | 3 | const { SetAppIcon } = NativeModules; 4 | 5 | export default SetAppIcon; 6 | -------------------------------------------------------------------------------- /ios/SetAppIcon.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface SetAppIcon : NSObject 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/SetAppIcon.m: -------------------------------------------------------------------------------- 1 | #import "React/RCTLog.h" 2 | #import "SetAppIcon.h" 3 | 4 | @implementation SetAppIcon 5 | 6 | RCT_EXPORT_MODULE() 7 | 8 | RCT_REMAP_METHOD(supportsDynamicAppIcon, resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) 9 | { 10 | if (@available(iOS 10.3, *)) { 11 | bool supported = [[UIApplication sharedApplication] supportsAlternateIcons]; 12 | resolve(@(supported)); 13 | } else { 14 | resolve(@(NO)); 15 | } 16 | } 17 | 18 | RCT_REMAP_METHOD(changeIcon, iconName:(NSString *)iconName resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { 19 | NSError *error = nil; 20 | 21 | // Not supported 22 | if (@available(iOS 10.3, *)) { 23 | if ([[UIApplication sharedApplication] supportsAlternateIcons] == NO) { 24 | reject(@"Error", @"Alternate icon not supported", error); 25 | RCTLog(@"Alternate Icons are not supported on this device"); 26 | return; 27 | } 28 | } else { 29 | reject(@"Error", @"This feature requires iOS 10.3 or higher", error); 30 | RCTLog(@"Alternate Icons are not supported on this device"); 31 | return; 32 | } 33 | 34 | if (@available(iOS 10.3, *)) { 35 | NSString *currentIcon = [[UIApplication sharedApplication] alternateIconName]; 36 | 37 | // If icon is already in use 38 | if ([iconName isEqualToString:currentIcon]) { 39 | reject(@"Error", @"Icon already in use", error); 40 | RCTLog(@"Icon already in use"); 41 | return; 42 | } 43 | } else { 44 | reject(@"Error", @"This feature requires iOS 10.3 or higher", error); 45 | RCTLog(@"Alternate Icons are not supported on this device"); 46 | return; 47 | } 48 | 49 | resolve(@(YES)); 50 | 51 | // Custom icon 52 | if (@available(iOS 10.3, *)) { 53 | [[UIApplication sharedApplication] setAlternateIconName:iconName completionHandler:^(NSError * _Nullable error) { 54 | RCTLog(@"%@", [error description]); 55 | }]; 56 | } else { 57 | reject(@"Error", @"This feature requires iOS 10.3 or higher", error); 58 | RCTLog(@"Alternate Icons are not supported on this device"); 59 | return; 60 | } 61 | } 62 | 63 | RCT_EXPORT_METHOD(getIconName:(RCTResponseSenderBlock) callback){ 64 | NSString *name = @"default"; 65 | NSDictionary *results; 66 | 67 | if (@available(iOS 10.3, *)) { 68 | if( [[UIApplication sharedApplication] supportsAlternateIcons ] ){ 69 | name = [[UIApplication sharedApplication] alternateIconName]; 70 | if(name == nil){ 71 | name = @"default"; 72 | } 73 | } 74 | } 75 | 76 | results = @{ 77 | @"iconName":name 78 | }; 79 | callback(@[results]); 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /ios/SetAppIcon.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXCopyFilesBuildPhase section */ 10 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 11 | isa = PBXCopyFilesBuildPhase; 12 | buildActionMask = 2147483647; 13 | dstPath = "include/$(PRODUCT_NAME)"; 14 | dstSubfolderSpec = 16; 15 | files = ( 16 | ); 17 | runOnlyForDeploymentPostprocessing = 0; 18 | }; 19 | /* End PBXCopyFilesBuildPhase section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 134814201AA4EA6300B7C361 /* libSetAppIcon.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSetAppIcon.a; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | /* End PBXFileReference section */ 24 | 25 | /* Begin PBXFrameworksBuildPhase section */ 26 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 27 | isa = PBXFrameworksBuildPhase; 28 | buildActionMask = 2147483647; 29 | files = ( 30 | ); 31 | runOnlyForDeploymentPostprocessing = 0; 32 | }; 33 | /* End PBXFrameworksBuildPhase section */ 34 | 35 | /* Begin PBXGroup section */ 36 | 134814211AA4EA7D00B7C361 /* Products */ = { 37 | isa = PBXGroup; 38 | children = ( 39 | 134814201AA4EA6300B7C361 /* libSetAppIcon.a */, 40 | ); 41 | name = Products; 42 | sourceTree = ""; 43 | }; 44 | 58B511D21A9E6C8500147676 = { 45 | isa = PBXGroup; 46 | children = ( 47 | 134814211AA4EA7D00B7C361 /* Products */, 48 | ); 49 | sourceTree = ""; 50 | }; 51 | /* End PBXGroup section */ 52 | 53 | /* Begin PBXNativeTarget section */ 54 | 58B511DA1A9E6C8500147676 /* SetAppIcon */ = { 55 | isa = PBXNativeTarget; 56 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "SetAppIcon" */; 57 | buildPhases = ( 58 | 58B511D71A9E6C8500147676 /* Sources */, 59 | 58B511D81A9E6C8500147676 /* Frameworks */, 60 | 58B511D91A9E6C8500147676 /* CopyFiles */, 61 | ); 62 | buildRules = ( 63 | ); 64 | dependencies = ( 65 | ); 66 | name = SetAppIcon; 67 | productName = RCTDataManager; 68 | productReference = 134814201AA4EA6300B7C361 /* libSetAppIcon.a */; 69 | productType = "com.apple.product-type.library.static"; 70 | }; 71 | /* End PBXNativeTarget section */ 72 | 73 | /* Begin PBXProject section */ 74 | 58B511D31A9E6C8500147676 /* Project object */ = { 75 | isa = PBXProject; 76 | attributes = { 77 | LastUpgradeCheck = 0920; 78 | ORGANIZATIONNAME = Facebook; 79 | TargetAttributes = { 80 | 58B511DA1A9E6C8500147676 = { 81 | CreatedOnToolsVersion = 6.1.1; 82 | }; 83 | }; 84 | }; 85 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "SetAppIcon" */; 86 | compatibilityVersion = "Xcode 3.2"; 87 | developmentRegion = en; 88 | hasScannedForEncodings = 0; 89 | knownRegions = ( 90 | en, 91 | Base, 92 | ); 93 | mainGroup = 58B511D21A9E6C8500147676; 94 | productRefGroup = 58B511D21A9E6C8500147676; 95 | projectDirPath = ""; 96 | projectRoot = ""; 97 | targets = ( 98 | 58B511DA1A9E6C8500147676 /* SetAppIcon */, 99 | ); 100 | }; 101 | /* End PBXProject section */ 102 | 103 | /* Begin PBXSourcesBuildPhase section */ 104 | 58B511D71A9E6C8500147676 /* Sources */ = { 105 | isa = PBXSourcesBuildPhase; 106 | buildActionMask = 2147483647; 107 | files = ( 108 | ); 109 | runOnlyForDeploymentPostprocessing = 0; 110 | }; 111 | /* End PBXSourcesBuildPhase section */ 112 | 113 | /* Begin XCBuildConfiguration section */ 114 | 58B511ED1A9E6C8500147676 /* Debug */ = { 115 | isa = XCBuildConfiguration; 116 | buildSettings = { 117 | ALWAYS_SEARCH_USER_PATHS = NO; 118 | CLANG_ANALYZER_NONNULL = YES; 119 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 120 | CLANG_CXX_LIBRARY = "libc++"; 121 | CLANG_ENABLE_MODULES = YES; 122 | CLANG_ENABLE_OBJC_ARC = YES; 123 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 124 | CLANG_WARN_BOOL_CONVERSION = YES; 125 | CLANG_WARN_COMMA = YES; 126 | CLANG_WARN_CONSTANT_CONVERSION = YES; 127 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 128 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 129 | CLANG_WARN_EMPTY_BODY = YES; 130 | CLANG_WARN_ENUM_CONVERSION = YES; 131 | CLANG_WARN_INFINITE_RECURSION = YES; 132 | CLANG_WARN_INT_CONVERSION = YES; 133 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 134 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 135 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 136 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 137 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 138 | CLANG_WARN_STRICT_PROTOTYPES = YES; 139 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 140 | CLANG_WARN_UNREACHABLE_CODE = YES; 141 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 142 | COPY_PHASE_STRIP = NO; 143 | ENABLE_STRICT_OBJC_MSGSEND = YES; 144 | ENABLE_TESTABILITY = YES; 145 | GCC_C_LANGUAGE_STANDARD = gnu99; 146 | GCC_DYNAMIC_NO_PIC = NO; 147 | GCC_NO_COMMON_BLOCKS = YES; 148 | GCC_OPTIMIZATION_LEVEL = 0; 149 | GCC_PREPROCESSOR_DEFINITIONS = ( 150 | "DEBUG=1", 151 | "$(inherited)", 152 | ); 153 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 154 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 155 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 156 | GCC_WARN_UNDECLARED_SELECTOR = YES; 157 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 158 | GCC_WARN_UNUSED_FUNCTION = YES; 159 | GCC_WARN_UNUSED_VARIABLE = YES; 160 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 161 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; 162 | LIBRARY_SEARCH_PATHS = ( 163 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 164 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 165 | "\"$(inherited)\"", 166 | ); 167 | MTL_ENABLE_DEBUG_INFO = YES; 168 | ONLY_ACTIVE_ARCH = YES; 169 | SDKROOT = iphoneos; 170 | }; 171 | name = Debug; 172 | }; 173 | 58B511EE1A9E6C8500147676 /* Release */ = { 174 | isa = XCBuildConfiguration; 175 | buildSettings = { 176 | ALWAYS_SEARCH_USER_PATHS = NO; 177 | CLANG_ANALYZER_NONNULL = YES; 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_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 187 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 188 | CLANG_WARN_EMPTY_BODY = YES; 189 | CLANG_WARN_ENUM_CONVERSION = YES; 190 | CLANG_WARN_INFINITE_RECURSION = YES; 191 | CLANG_WARN_INT_CONVERSION = YES; 192 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 193 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 194 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 195 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 196 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 197 | CLANG_WARN_STRICT_PROTOTYPES = YES; 198 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 199 | CLANG_WARN_UNREACHABLE_CODE = YES; 200 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 201 | COPY_PHASE_STRIP = YES; 202 | ENABLE_NS_ASSERTIONS = NO; 203 | ENABLE_STRICT_OBJC_MSGSEND = YES; 204 | GCC_C_LANGUAGE_STANDARD = gnu99; 205 | GCC_NO_COMMON_BLOCKS = YES; 206 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 207 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 208 | GCC_WARN_UNDECLARED_SELECTOR = YES; 209 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 210 | GCC_WARN_UNUSED_FUNCTION = YES; 211 | GCC_WARN_UNUSED_VARIABLE = YES; 212 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 213 | LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; 214 | LIBRARY_SEARCH_PATHS = ( 215 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 216 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", 217 | "\"$(inherited)\"", 218 | ); 219 | MTL_ENABLE_DEBUG_INFO = NO; 220 | SDKROOT = iphoneos; 221 | VALIDATE_PRODUCT = YES; 222 | }; 223 | name = Release; 224 | }; 225 | 58B511F01A9E6C8500147676 /* Debug */ = { 226 | isa = XCBuildConfiguration; 227 | buildSettings = { 228 | HEADER_SEARCH_PATHS = ( 229 | "$(inherited)", 230 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 231 | "$(SRCROOT)/../../../React/**", 232 | "$(SRCROOT)/../../react-native/React/**", 233 | ); 234 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 235 | OTHER_LDFLAGS = "-ObjC"; 236 | PRODUCT_NAME = SetAppIcon; 237 | SKIP_INSTALL = YES; 238 | }; 239 | name = Debug; 240 | }; 241 | 58B511F11A9E6C8500147676 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | HEADER_SEARCH_PATHS = ( 245 | "$(inherited)", 246 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 247 | "$(SRCROOT)/../../../React/**", 248 | "$(SRCROOT)/../../react-native/React/**", 249 | ); 250 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 251 | OTHER_LDFLAGS = "-ObjC"; 252 | PRODUCT_NAME = SetAppIcon; 253 | SKIP_INSTALL = YES; 254 | }; 255 | name = Release; 256 | }; 257 | /* End XCBuildConfiguration section */ 258 | 259 | /* Begin XCConfigurationList section */ 260 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "SetAppIcon" */ = { 261 | isa = XCConfigurationList; 262 | buildConfigurations = ( 263 | 58B511ED1A9E6C8500147676 /* Debug */, 264 | 58B511EE1A9E6C8500147676 /* Release */, 265 | ); 266 | defaultConfigurationIsVisible = 0; 267 | defaultConfigurationName = Release; 268 | }; 269 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "SetAppIcon" */ = { 270 | isa = XCConfigurationList; 271 | buildConfigurations = ( 272 | 58B511F01A9E6C8500147676 /* Debug */, 273 | 58B511F11A9E6C8500147676 /* Release */, 274 | ); 275 | defaultConfigurationIsVisible = 0; 276 | defaultConfigurationName = Release; 277 | }; 278 | /* End XCConfigurationList section */ 279 | }; 280 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 281 | } 282 | -------------------------------------------------------------------------------- /ios/SetAppIcon.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-set-app-icon", 3 | "title": "React Native Set App Icon", 4 | "version": "0.0.9", 5 | "description": "Set app icon inside your application", 6 | "main": "index.js", 7 | "files": [ 8 | "README.md", 9 | "android", 10 | "index.js", 11 | "index.d.ts", 12 | "ios", 13 | "react-native-set-app-icon.podspec" 14 | ], 15 | "types": "index.d.ts", 16 | "scripts": { 17 | "test": "echo \"Error: no test specified\" && exit 1" 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "git+https://github.com/EQuimper/react-native-set-app-icon.git", 22 | "baseUrl": "https://github.com/EQuimper/react-native-set-app-icon" 23 | }, 24 | "keywords": [ 25 | "react-native" 26 | ], 27 | "author": { 28 | "name": "Emanuel Quimper", 29 | "email": "quimperemanuel@gmail.com" 30 | }, 31 | "license": "MIT", 32 | "licenseFilename": "LICENSE", 33 | "readmeFilename": "README.md", 34 | "peerDependencies": { 35 | "react": "^16.8.1", 36 | "react-native": ">=0.60.0-rc.0 <1.0.x" 37 | }, 38 | "devDependencies": { 39 | "react": "^16.9.0", 40 | "react-native": "^0.61.5" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /react-native-set-app-icon.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "react-native-set-app-icon" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | react-native-set-app-icon 11 | DESC 12 | s.homepage = "https://github.com/EQuimper/react-native-set-app-icon" 13 | # brief license entry: 14 | s.license = "MIT" 15 | # optional - use expanded license entry instead: 16 | # s.license = { :type => "MIT", :file => "LICENSE" } 17 | s.authors = { "Your Name" => "quimperemanuel@gmail.com" } 18 | s.platforms = { :ios => "9.0" } 19 | s.source = { :git => "https://github.com/EQuimper/react-native-set-app-icon.git", :tag => "#{s.version}" } 20 | 21 | s.source_files = "ios/**/*.{h,c,m,swift}" 22 | s.requires_arc = true 23 | 24 | s.dependency "React" 25 | # ... 26 | # s.dependency "..." 27 | end 28 | 29 | --------------------------------------------------------------------------------