-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[CHORE] App Group path as a iOS constant #2439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { NativeModules } from 'react-native'; | ||
|
|
||
| import { isIOS } from './deviceInfo'; | ||
|
|
||
| const { AppGroup } = NativeModules; | ||
|
|
||
| const appGroup = { | ||
| path: isIOS ? AppGroup.path : '' | ||
| }; | ||
|
|
||
| export default appGroup; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // | ||
| // AppGroup.m | ||
| // RocketChatRN | ||
| // | ||
| // Created by Djorkaeff Alexandre Vilela Pereira on 8/31/20. | ||
| // Copyright © 2020 Facebook. All rights reserved. | ||
| // | ||
|
|
||
| #import "React/RCTBridgeModule.h" | ||
| @interface RCT_EXTERN_MODULE(AppGroup, NSObject) | ||
| @end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // | ||
| // AppGroup.swift | ||
| // RocketChatRN | ||
| // | ||
| // Created by Djorkaeff Alexandre Vilela Pereira on 8/31/20. | ||
| // Copyright © 2020 Facebook. All rights reserved. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| @objc(AppGroup) | ||
| class AppGroup: NSObject { | ||
|
|
||
| @objc | ||
| func constantsToExport() -> [AnyHashable : Any]! { | ||
| // Get App Group directory | ||
| var path = "" | ||
| if let suiteName = Bundle.main.object(forInfoDictionaryKey: "AppGroup") as? String { | ||
| if let directory = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: suiteName) { | ||
| path = directory.path | ||
| } | ||
| } | ||
|
|
||
| return ["path": "\(path)/"] | ||
| } | ||
| } |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice