Coder Social home page Coder Social logo

andrew-levy / react-native-safari-extension Goto Github PK

View Code? Open in Web Editor NEW
118.0 5.0 8.0 2.47 MB

Expo Config Plugin to add a Safari Extension to a React Native iOS App

Home Page: https://react-native-safari-extension.vercel.app

JavaScript 0.99% TypeScript 99.01%

react-native-safari-extension's Introduction

react-native-safari-extension's People

Contributors

andrew-levy avatar nickcruz avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

react-native-safari-extension's Issues

Extension.entitlements could not be opened

I'm running into this error when building a Expo Dev Client locally:
โŒ error: The file "/var/folders/px/xg99v_l53hbc4yy9_58c23q00000gn/T/eas-build-local-nodejs/7a5ecf27-d085-4f25-8c3c-427341cfcdb1/build/ios/DEVExtension/DEVExtension.entitlements" could not be opened. Verify the value of the CODE_SIGN_ENTITLEMENTS build setting for target "DEVExtension" is correct and that the file exists on disk. (in target 'DEVExtension' from project 'DEV')

I tried commenting out the CODE_SIGN_ENTITLEMENTS in addXCConfigurationList:
// CODE_SIGN_ENTITLEMENTS: `${extensionFolder}/${extensionFolder}.entitlements`,
but then I get Signing for "DEVExtension" requires a development team - which I guess makes sense.

Any ideas on how to proceed? How do I generate the entitlements? Does it require an AppStore build maybe?

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler during eas build

I'm able to build the project locally via expo run:ios, but whenever I run eas build, it fails on the fast lane step with

`CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler

error: Build input file cannot be found: '/Users/andrewlevy/exampleApp/ios/exampleAppExtension/SafariWebExtensionHandler.swift' (in target 'exampleAppExtension' from project 'exampleApp')`

Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.

Great job on the config plugin! Running into an issue when attempting to build via expo. After I run

yarn eas build --profile preview --platform ios

I get the following error

๐ŸŽ iOS build failed:
Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.
To resolve this issue, downgrade to an older Xcode version using the "image" field in eas.json, or upgrade to SDK 46 or higher.
Learn more: https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations

I have gone ahead and done what the resolution suggests but still can not seem to get this to work. Is this something that you guys have run into, if so any suggestions?

Enhancement: Render react app with hot reload

  • instead of rendering html + js + css defined in the resource files, use react native web to render some RN code into the extension ๐Ÿคฏ
  • add hot reload so that any change would be reflected in the extension without a prebuild + run

small suggestion

could be nice to link to apple's website describing safari extensions

Bug: "Recovered References" is being added

If you open up the project or workspace in xcode after prebuilding, there is a Recovered References folder being added that shouldn't be. This is due to an issue in the pbxproj setup.

Provisioning profile "..." doesn't include the aps-environment entitlement. (in target '<my extension'> from project '<my project>'

Hi! I'm getting this error trying to make a local build:

error: Provisioning profile "*[expo] dev.mozzius.graysky.OpenInGrayskyExtension AppStore 2023-12-07T16:48:33.829Z" doesn't support the Push Notifications capability. (in target 'OpenInGrayskyExtension' from project 'Graysky')
error: Provisioning profile "*[expo] dev.mozzius.graysky.OpenInGrayskyExtension AppStore 2023-12-07T16:48:33.829Z" doesn't include the aps-environment entitlement. (in target 'OpenInGrayskyExtension' from project 'Graysky')

I do want to use expo-notifications in my main app, but it seems this breaks the safari extension. Looking at the code, it seems the config plugin does try to delete the aps-environment entitlement - not sure if that's just not working, or if something else is going on.

React Native 0.73 support

Hello. I'm unable to update to Expo 50 due to a problem with the React Native Podfile post-install hook.

[!] An error occurred while processing the post-install hook of the Podfile.

[!] The plist file at path `/Users/samuel.newman/Documents/Other/graysky/apps/expo/ios/Info.plist` doesn't exist.


/opt/homebrew/Cellar/cocoapods/1.14.3/libexec/gems/xcodeproj-1.23.0/lib/xcodeproj/plist.rb:17:in `read_from_path'
/Users/samuel.newman/Documents/Other/graysky/node_modules/react-native/scripts/cocoapods/utils.rb:557:in `block in update_ats_in_plist'
/Users/samuel.newman/Documents/Other/graysky/node_modules/react-native/scripts/cocoapods/utils.rb:554:in `each'
/Users/samuel.newman/Documents/Other/graysky/node_modules/react-native/scripts/cocoapods/utils.rb:554:in `update_ats_in_plist'
/Users/samuel.newman/Documents/Other/graysky/node_modules/react-native/scripts/cocoapods/utils.rb:579:in `apply_ats_config'
/Users/samuel.newman/Documents/Other/graysky/node_modules/react-native/scripts/react_native_pods.rb:310:in `react_native_post_install'
/Users/samuel.newman/Documents/Other/graysky/apps/expo/ios/Podfile:57:in `block (3 levels) in from_ruby'

Seems it tries to find all Info.plist files using this code:

def self.get_plist_paths_from(user_project)
  info_plists = user_project
    .files
    .select { |p|
      p.name&.end_with?('Info.plist')
    }
  return info_plists
end

However, printing all the paths for these files shows this:

Expo.plist
Graysky/AppDelegate.h
Graysky/AppDelegate.mm
Graysky/Images.xcassets
Graysky/Info.plist
Graysky/main.m
Graysky/SplashScreen.storyboard
Graysky/noop-file.swift
Graysky/Graysky-Bridging-Header.h
Graysky.app
System/Library/Frameworks/JavaScriptCore.framework
libPods-Graysky.a
Target Support Files/Pods-Graysky/Pods-Graysky.debug.xcconfig
Target Support Files/Pods-Graysky/Pods-Graysky.release.xcconfig
Pods/Target Support Files/Pods-Graysky/ExpoModulesProvider.swift
src
assets
manifest.json
Info.plist
SafariWebExtensionHandler.swift
OpenInGrayskyExtension.appex

Since these extension files don't have the correct paths (specifically the Info.plist file), when it tries to open /ios/Info.plist it breaks.

error: index.js: Cannot find module 'react-native-reanimated/plugin'

Hi, I'm getting error: index.js: Cannot find module 'react-native-reanimated/plugin' when running the extension app. I have the plugin on my babel.config.js and everything works fine on the main Expo application.

If I remove the plugin from the config I get a new error about another npm dependency (base-64 required by react-native-polyfill-globals), it looks like it's failing to find some node_modules?

Do you have any idea?

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.