chore: bump version to 1.1.4
This commit is contained in:
@@ -29,7 +29,7 @@ import UniformTypeIdentifiers
|
||||
|
||||
class ShareViewController: UIViewController {
|
||||
|
||||
private let appGroupIdentifier = "group.app.timesafari"
|
||||
private let appGroupIdentifier = "group.app.timesafari.share"
|
||||
private let sharedPhotoBase64Key = "sharedPhotoBase64"
|
||||
private let sharedPhotoFileNameKey = "sharedPhotoFileName"
|
||||
|
||||
@@ -155,7 +155,7 @@ private func openMainApp() {
|
||||
|
||||
// In AppDelegate.swift
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
let appGroupIdentifier = "group.app.timesafari"
|
||||
let appGroupIdentifier = "group.app.timesafari.share"
|
||||
guard let userDefaults = UserDefaults(suiteName: appGroupIdentifier) else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ App Groups allow the Share Extension and main app to share data.
|
||||
3. Click **+ Capability**
|
||||
4. Select **App Groups**
|
||||
5. Click **+** to add a new group
|
||||
6. Enter: `group.app.timesafari`
|
||||
6. Enter: `group.app.timesafari.share`
|
||||
7. Ensure it's checked/enabled
|
||||
|
||||
### For Share Extension Target:
|
||||
@@ -52,7 +52,7 @@ App Groups allow the Share Extension and main app to share data.
|
||||
3. Click **+ Capability**
|
||||
4. Select **App Groups**
|
||||
5. Click **+** to add a new group
|
||||
6. Enter: `group.app.timesafari` (same as main app)
|
||||
6. Enter: `group.app.timesafari.share` (same as main app)
|
||||
7. Ensure it's checked/enabled
|
||||
|
||||
**Important:** Both targets must use the **exact same** App Group identifier.
|
||||
|
||||
@@ -119,7 +119,7 @@ class ShareViewController: SLComposeServiceViewController {
|
||||
let base64String = imageData.base64EncodedString()
|
||||
|
||||
// Store in shared UserDefaults (accessible by main app)
|
||||
let userDefaults = UserDefaults(suiteName: "group.app.timesafari")
|
||||
let userDefaults = UserDefaults(suiteName: "group.app.timesafari.share")
|
||||
userDefaults?.set(base64String, forKey: "sharedPhotoBase64")
|
||||
userDefaults?.set(fileName ?? "shared-image.jpg", forKey: "sharedPhotoFileName")
|
||||
userDefaults?.synchronize()
|
||||
@@ -149,7 +149,7 @@ class ShareViewController: SLComposeServiceViewController {
|
||||
|
||||
1. In Xcode, select main app target → Signing & Capabilities
|
||||
2. Add "App Groups" capability
|
||||
3. Create group: `group.app.timesafari`
|
||||
3. Create group: `group.app.timesafari.share`
|
||||
4. Repeat for Share Extension target with same group name
|
||||
|
||||
#### 1.5 Update Main App to Read from App Group
|
||||
|
||||
@@ -78,7 +78,7 @@ import Capacitor
|
||||
|
||||
@objc(SharedImagePlugin)
|
||||
public class SharedImagePlugin: CAPPlugin {
|
||||
private let appGroupIdentifier = "group.app.timesafari"
|
||||
private let appGroupIdentifier = "group.app.timesafari.share"
|
||||
|
||||
@objc func getSharedImage(_ call: CAPPluginCall) {
|
||||
// Read from App Group UserDefaults
|
||||
@@ -504,7 +504,7 @@ If issues arise:
|
||||
## Additional Notes
|
||||
|
||||
### iOS App Group:
|
||||
- Current App Group ID: `group.app.timesafari`
|
||||
- Current App Group ID: `group.app.timesafari.share`
|
||||
- Ensure plugin has access to same App Group
|
||||
- Share Extension already writes to this App Group
|
||||
|
||||
|
||||
Reference in New Issue
Block a user