Skip to content

Commit a62ce81

Browse files
author
Hardik Sharma
committed
feat: [Manually iOS linking with bridging header fixes, now it will do everything automatically]
1 parent be31c64 commit a62ce81

File tree

10 files changed

+25
-27
lines changed

10 files changed

+25
-27
lines changed

example/ios/File.swift

Lines changed: 0 additions & 6 deletions
This file was deleted.

example/ios/ModifierExample-Bridging-Header.h

Lines changed: 0 additions & 7 deletions
This file was deleted.

example/ios/ModifierExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@
500500
PRODUCT_NAME = ModifierExample;
501501
PROVISIONING_PROFILE_SPECIFIER = "";
502502
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShotDoctorRelease;
503+
SWIFT_OBJC_BRIDGING_HEADER = "";
503504
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
504505
SWIFT_VERSION = 5.0;
505506
VERSIONING_SYSTEM = "apple-generic";
@@ -534,6 +535,7 @@
534535
PRODUCT_NAME = ModifierExample;
535536
PROVISIONING_PROFILE_SPECIFIER = "";
536537
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShotDoctorRelease;
538+
SWIFT_OBJC_BRIDGING_HEADER = "";
537539
SWIFT_VERSION = 5.0;
538540
VERSIONING_SYSTEM = "apple-generic";
539541
};

example/ios/Podfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ENV['RCT_NEW_ARCH_ENABLED'] = '1'
2+
ENV['USE_FRAMEWORKS'] = 'static'
23

34
# Resolve react_native_pods.rb with node to allow for hoisting
45
require Pod::Executable.execute_command('node', ['-p',
@@ -24,7 +25,7 @@ target 'ModifierExample' do
2425
# An absolute path to your application root.
2526
:app_path => "#{Pod::Config.instance.installation_root}/.."
2627
)
27-
28+
2829
target 'ModifierExampleTests' do
2930
inherit! :complete
3031
# Pods for testing

ios/AppleSignin.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import Foundation
88
import AuthenticationServices
99

10-
11-
class AppleSignin: NSObject {
10+
@objc(AppleSignin)
11+
public class AppleSignin: NSObject {
1212

1313
@objc
14-
func signInWithApple(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
14+
public func signInWithApple(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
1515
AppleSignInManager.shared.startSignInWithAppleFlow(appleBtn: false)
1616
// Simulate an asynchronous operation, e.g., a network request
1717
DispatchQueue.global().async {

ios/Modifier.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
#ifdef RCT_NEW_ARCH_ENABLED
22
#import "RNModifierSpec.h"
3-
3+
#import <react_native_modifier/react_native_modifier-Swift.h>
4+
//#import "react_native_modifier-Swift.h"
5+
NS_ASSUME_NONNULL_BEGIN
46
@interface Modifier : NSObject <NativeModifierSpec>
7+
@end
8+
NS_ASSUME_NONNULL_END
59
#else
610
#import <React/RCTBridgeModule.h>
711

812
@interface Modifier : NSObject <RCTBridgeModule>
9-
#endif
10-
1113
@end
14+
15+
#endif

ios/Modifier.mm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#import "Modifier.h"
2-
#import "react_native_modifier-Swift.h"
32
#import "React/RCTBridgeModule.h"
43

5-
64
@implementation Modifier
75
RCT_EXPORT_MODULE()
86

@@ -28,6 +26,10 @@ @implementation Modifier
2826
[swiftClass signInWithApple:resolve reject: reject];
2927
}
3028

29+
- (void)configureSignin:(NSDictionary *)configObject resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
30+
}
31+
32+
3133
RCT_EXTERN_METHOD(supportedEvents)
3234

3335
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
@@ -37,6 +39,7 @@ @implementation Modifier
3739
}
3840
#endif
3941

42+
4043
@end
4144

4245

ios/ModifierMultiply.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
@objc
3+
@objc(ModifierMultiply)
44
public class ModifierMultiply: NSObject {
55
@objc
66
public func methodModifier(a: Double, b: Double) -> Double {

react-native-modifier.podspec

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Pod::Spec.new do |s|
1212
s.authors = package["author"]
1313

1414
s.platforms = { :ios => min_ios_version_supported }
15-
s.source = { :git => "https://github.com/sharmahdk13s/react-native-modifier.git", :tag => "#{s.version}" }
16-
17-
s.source_files = "ios/**/*.{h,m,mm,cpp}"
15+
s.source = { :git => "https://github.com/sharmahdk13s/react-native-apple-signin-modifier", :tag => "#{s.version}" }
1816

17+
s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
18+
s.public_header_files = "ios/*.{h,hpp}"
1919
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
2020
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
2121
if respond_to?(:install_modules_dependencies, true)
@@ -29,7 +29,8 @@ Pod::Spec.new do |s|
2929
s.pod_target_xcconfig = {
3030
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
3131
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
32-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
32+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
33+
"SWIFT_OBJC_BRIDGING_HEADER" => "../../../ios/react-native-modifier-Bridging-Header.h"
3334
}
3435
s.dependency "React-Codegen"
3536
s.dependency "RCT-Folly"

0 commit comments

Comments
 (0)