Initial commit
33
ios/.gitignore
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
*.mode1v3
|
||||
*.mode2v3
|
||||
*.moved-aside
|
||||
*.pbxuser
|
||||
*.perspectivev3
|
||||
**/*sync/
|
||||
.sconsign.dblite
|
||||
.tags*
|
||||
**/.vagrant/
|
||||
**/DerivedData/
|
||||
Icon?
|
||||
**/Pods/
|
||||
**/.symlinks/
|
||||
profile
|
||||
xcuserdata
|
||||
**/.generated/
|
||||
Flutter/App.framework
|
||||
Flutter/Flutter.framework
|
||||
Flutter/Flutter.podspec
|
||||
Flutter/Generated.xcconfig
|
||||
Flutter/app.flx
|
||||
Flutter/app.zip
|
||||
Flutter/flutter_assets/
|
||||
Flutter/flutter_export_environment.sh
|
||||
ServiceDefinitions.json
|
||||
Runner/GeneratedPluginRegistrant.*
|
||||
build/
|
||||
|
||||
# Exceptions to above rules.
|
||||
!default.mode1v3
|
||||
!default.mode2v3
|
||||
!default.pbxuser
|
||||
!default.perspectivev3
|
||||
24
ios/FluffyChat Share/Base.lproj/MainInterface.storyboard
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="j1y-V4-xli">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Share View Controller-->
|
||||
<scene sceneID="ceB-am-kn3">
|
||||
<objects>
|
||||
<viewController id="j1y-V4-xli" customClass="ShareViewController" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" opaque="NO" contentMode="scaleToFill" id="wbc-yd-nQP">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<viewLayoutGuide key="safeArea" id="1Xd-am-t49"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="CEy-Cv-SGf" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
10
ios/FluffyChat Share/FluffyChat Share.entitlements
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.im.fluffychat.app</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
52
ios/FluffyChat Share/Info.plist
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>TatuChat Share</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionAttributes</key>
|
||||
<dict>
|
||||
<key>NSExtensionActivationRule</key>
|
||||
<dict>
|
||||
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
|
||||
<integer>10</integer>
|
||||
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
|
||||
<integer>10</integer>
|
||||
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
|
||||
<integer>10</integer>
|
||||
<key>NSExtensionActivationSupportsText</key>
|
||||
<true/>
|
||||
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>PHSupportedMediaTypes</key>
|
||||
<array>
|
||||
<string>Video</string>
|
||||
<string>Image</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
<string>MainInterface</string>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.share-services</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
28
ios/FluffyChat Share/ShareViewController.swift
Normal file
@@ -0,0 +1,28 @@
|
||||
// If you get no such module 'receive_sharing_intent' error.
|
||||
// Go to Build Phases of your Runner target and
|
||||
// move `Embed Foundation Extension` to the top of `Thin Binary`.
|
||||
import receive_sharing_intent
|
||||
|
||||
class ShareViewController: RSIShareViewController {
|
||||
|
||||
// Use this method to return false if you don't want to redirect to host app automatically.
|
||||
// Default is true
|
||||
override func shouldAutoRedirect() -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Workaround to not display post dialog from
|
||||
// https://github.com/KasemJaffer/receive_sharing_intent/issues/207#issuecomment-2024329619
|
||||
open override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
// Auto-trigger completion for URLs/text content
|
||||
// The parent class processes attachments, but we need to ensure completion
|
||||
// when view is hidden, especially for text/URL content
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
|
||||
// Small delay to allow parent processing to complete
|
||||
// Then trigger post to ensure extension completes
|
||||
self?.didSelectPost()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
24
ios/Flutter/AppFrameworkInfo.plist
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>App</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>io.flutter.flutter.app</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>App</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
2
ios/Flutter/Debug.xcconfig
Normal file
@@ -0,0 +1,2 @@
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
2
ios/Flutter/Release.xcconfig
Normal file
@@ -0,0 +1,2 @@
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
8
ios/Gemfile
Normal file
@@ -0,0 +1,8 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "fastlane"
|
||||
|
||||
# Workaround for ruby 3.4 https://github.com/fastlane/fastlane/issues/29183
|
||||
gem "abbrev"
|
||||
gem "mutex_m"
|
||||
gem "ostruct"
|
||||
58
ios/Localizable.xcstrings
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"sourceLanguage" : "en",
|
||||
"strings" : {
|
||||
"%lld unread messages" : {
|
||||
"comment" : "Default notification title",
|
||||
"localizations" : {
|
||||
"de" : {
|
||||
"variations" : {
|
||||
"plural" : {
|
||||
"one" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Ungelesene Nachricht"
|
||||
}
|
||||
},
|
||||
"other" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "%lld ungelesene nachrichten"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"en" : {
|
||||
"variations" : {
|
||||
"plural" : {
|
||||
"one" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Unread message"
|
||||
}
|
||||
},
|
||||
"other" : {
|
||||
"stringUnit" : {
|
||||
"state" : "new",
|
||||
"value" : "%lld unread messages"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"New message - open app to read" : {
|
||||
"comment" : "Default notification body",
|
||||
"localizations" : {
|
||||
"de" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Neue Nachricht - App öffnen zum lesen"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"version" : "1.0"
|
||||
}
|
||||
13
ios/Notification Service Extension/Info.plist
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.usernotifications.service</string>
|
||||
<key>NSExtensionPrincipalClass</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).NotificationService</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.im.fluffychat.app</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
416
ios/Notification Service Extension/NotificationService.swift
Normal file
@@ -0,0 +1,416 @@
|
||||
//
|
||||
// NotificationService.swift
|
||||
// Notification Extension
|
||||
//
|
||||
// Created by Christian Pauly on 26.08.25.
|
||||
//
|
||||
|
||||
import FMDB
|
||||
import Foundation
|
||||
import UserNotifications
|
||||
import os
|
||||
|
||||
class NotificationService: UNNotificationServiceExtension {
|
||||
|
||||
var contentHandler: ((UNNotificationContent) -> Void)?
|
||||
var bestAttemptContent: UNMutableNotificationContent?
|
||||
|
||||
override func didReceive(
|
||||
_ request: UNNotificationRequest,
|
||||
withContentHandler contentHandler:
|
||||
@escaping (UNNotificationContent) -> Void
|
||||
) {
|
||||
self.contentHandler = contentHandler
|
||||
bestAttemptContent =
|
||||
(request.content.mutableCopy() as? UNMutableNotificationContent)
|
||||
|
||||
guard let bestAttemptContent = bestAttemptContent else { return }
|
||||
|
||||
// Uncomment to read the push message payload:
|
||||
// os_log("[FluffyChatPushHelper] New message received: %{public}@", log: .default, type: .error, bestAttemptContent.userInfo)
|
||||
os_log("[FluffyChatPushHelper] New message received")
|
||||
|
||||
// Check if notification contains room ID and event ID:
|
||||
guard let roomId = bestAttemptContent.userInfo["room_id"] as? String,
|
||||
let eventId = bestAttemptContent.userInfo["event_id"] as? String
|
||||
else {
|
||||
os_log("[FluffyChatPushHelper] Room ID or Event ID is missing!")
|
||||
let emptyContent = UNMutableNotificationContent()
|
||||
contentHandler(emptyContent)
|
||||
return
|
||||
}
|
||||
|
||||
// Set thread identifier and fallback body:
|
||||
bestAttemptContent.body = String(
|
||||
localized: "New message - open app to read",
|
||||
comment: "Default notification body"
|
||||
)
|
||||
|
||||
var unread: Int?
|
||||
if let countsJson = bestAttemptContent.userInfo["counts"] as? String,
|
||||
let counts = try? JSONDecoder().decode(
|
||||
NotificationCounts.self,
|
||||
from: countsJson.data(using: .utf8)!
|
||||
)
|
||||
{
|
||||
unread = counts.unread
|
||||
}
|
||||
|
||||
// Set badge and fallback title:
|
||||
bestAttemptContent.title = String(
|
||||
localized: "\(unread ?? 1) unread messages",
|
||||
comment: "Default notification title"
|
||||
)
|
||||
if let unread = unread {
|
||||
bestAttemptContent.badge = NSNumber(integerLiteral: unread)
|
||||
}
|
||||
|
||||
// Fetch the client_name:
|
||||
guard
|
||||
let devicesJson = bestAttemptContent.userInfo["devices"] as? String,
|
||||
let devices = try? JSONDecoder().decode(
|
||||
[NotificationDevice].self,
|
||||
from: devicesJson.data(using: .utf8)!
|
||||
),
|
||||
let clientName = devices.first?.data.client_name
|
||||
else {
|
||||
os_log(
|
||||
"[FluffyChatPushHelper] No client_name found in Push Notification!"
|
||||
)
|
||||
contentHandler(bestAttemptContent)
|
||||
return
|
||||
}
|
||||
|
||||
bestAttemptContent.threadIdentifier = "\(clientName)_\(roomId)"
|
||||
|
||||
// Open database:
|
||||
guard let key = getDatabaseKey() else {
|
||||
os_log("[FluffyChatPushHelper] Unable to get database key!")
|
||||
contentHandler(bestAttemptContent)
|
||||
return
|
||||
}
|
||||
guard let containerPath = FileManager.default.containerURL(
|
||||
forSecurityApplicationGroupIdentifier: "group.im.fluffychat.app"
|
||||
) else {
|
||||
os_log("[FluffyChatPushHelper] Unable to get container path!")
|
||||
contentHandler(bestAttemptContent)
|
||||
return
|
||||
}
|
||||
let databasePath = containerPath.appendingPathComponent("\(clientName).sqlite").path
|
||||
guard let database = getDatabase(key: key, path: databasePath) else {
|
||||
// getDatabase already logged the concrete SQLite error
|
||||
os_log("[FluffyChatPushHelper] Unable to open database!")
|
||||
contentHandler(bestAttemptContent)
|
||||
return
|
||||
}
|
||||
|
||||
// Get room name:
|
||||
var roomName = getRoomNameFromDatabase(
|
||||
database: database,
|
||||
roomId: roomId
|
||||
)
|
||||
var roomAvatarUrl = getRoomAvatarFromDatabase(database: database, roomId: roomId)
|
||||
|
||||
// Fall back to room heroes if no explicit room name
|
||||
if roomName == nil || roomAvatarUrl == nil {
|
||||
if let heroes = getRoomheroesFromDatabase(
|
||||
database: database,
|
||||
roomId: roomId
|
||||
) {
|
||||
if !heroes.isEmpty {
|
||||
roomName =
|
||||
roomName
|
||||
?? heroes.map { hero in
|
||||
hero.content.displayname
|
||||
?? String(localized: "FluffyChat User")
|
||||
}.joined(separator: ", ")
|
||||
roomAvatarUrl = roomAvatarUrl ?? heroes.first?.content.avatar_url
|
||||
} else {
|
||||
roomName = roomName ?? String(localized: "Empty chat")
|
||||
}
|
||||
} else {
|
||||
roomName = roomName ?? String(localized: "New chat")
|
||||
}
|
||||
}
|
||||
|
||||
if let roomName = roomName {
|
||||
bestAttemptContent.title = roomName
|
||||
}
|
||||
|
||||
if let roomAvatarUrl = roomAvatarUrl {
|
||||
do {
|
||||
let attachment = try downloadAttachment(url: roomAvatarUrl, containerPath: containerPath)
|
||||
bestAttemptContent.attachments = [attachment]
|
||||
} catch {
|
||||
os_log("[FluffyChatPushHelper] Unable to download avatar!")
|
||||
}
|
||||
}
|
||||
|
||||
contentHandler(bestAttemptContent)
|
||||
database.close()
|
||||
}
|
||||
|
||||
override func serviceExtensionTimeWillExpire() {
|
||||
// Called just before the extension will be terminated by the system.
|
||||
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
|
||||
if let contentHandler = contentHandler,
|
||||
let bestAttemptContent = bestAttemptContent
|
||||
{
|
||||
contentHandler(bestAttemptContent)
|
||||
}
|
||||
}
|
||||
|
||||
func getDatabaseKey() -> String? {
|
||||
// Fetch database key
|
||||
let query: [String: Any] = [
|
||||
kSecClass as String: kSecClassGenericPassword,
|
||||
kSecAttrService as String: "flutter_secure_storage_service",
|
||||
kSecAttrAccount as String: "database_password",
|
||||
kSecReturnData as String: true,
|
||||
kSecAttrAccessGroup as String: "group.im.fluffychat.app",
|
||||
]
|
||||
|
||||
var item: CFTypeRef?
|
||||
let status = SecItemCopyMatching(query as CFDictionary, &item)
|
||||
|
||||
guard status == errSecSuccess,
|
||||
let data = item as? Data,
|
||||
let key = String(data: data, encoding: .utf8)
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
return key
|
||||
}
|
||||
|
||||
func getDatabase(key: String, path: String) -> FMDatabase? {
|
||||
guard FileManager.default.fileExists(atPath: path) else { return nil }
|
||||
|
||||
let database = FMDatabase(path: "file:\(path)?immutable=1")
|
||||
// Open Database in read only mode:
|
||||
guard database.open(withFlags: 0x0000_0001) else {
|
||||
os_log(
|
||||
"[FluffyChatPushHelper] sqlite open failed: %{public}@",
|
||||
database.lastErrorMessage()
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Match Flutter / matrix-dart-sdk: PRAGMA KEY='…' (passphrase), not raw key bytes.
|
||||
let escapedKey = key.replacingOccurrences(of: "'", with: "''")
|
||||
guard database.executeStatements("PRAGMA key = '\(escapedKey)';") else {
|
||||
os_log(
|
||||
"[FluffyChatPushHelper] PRAGMA key failed: %{public}@",
|
||||
database.lastErrorMessage()
|
||||
)
|
||||
database.close()
|
||||
return nil
|
||||
}
|
||||
|
||||
guard database.goodConnection else {
|
||||
os_log(
|
||||
"[FluffyChatPushHelper] bad connection after key: %{public}@",
|
||||
database.lastErrorMessage()
|
||||
)
|
||||
database.close()
|
||||
return nil
|
||||
}
|
||||
|
||||
return database
|
||||
}
|
||||
|
||||
func getUserFromDatabase(
|
||||
database: FMDatabase,
|
||||
userId: String,
|
||||
roomId: String
|
||||
) -> UserEventJson? {
|
||||
do {
|
||||
let roomMemberDatabaseKey = [roomId, userId].joined(separator: "|")
|
||||
let roomMemberResult = try database.executeQuery(
|
||||
"SELECT * FROM box_room_members WHERE k=?",
|
||||
values: [roomMemberDatabaseKey]
|
||||
)
|
||||
if roomMemberResult.next(),
|
||||
let event = roomMemberResult.string(forColumn: "v")
|
||||
{
|
||||
let userEvent = try! JSONDecoder().decode(
|
||||
UserEventJson.self,
|
||||
from: event.data(using: .utf8)!
|
||||
)
|
||||
return userEvent
|
||||
}
|
||||
} catch {
|
||||
os_log(
|
||||
"[FluffyChatPushHelper] DB query failed: %{public}@",
|
||||
log: .default,
|
||||
type: .error,
|
||||
error.localizedDescription
|
||||
)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func getRoomAvatarFromDatabase(database: FMDatabase, roomId: String)
|
||||
-> String?
|
||||
{
|
||||
do {
|
||||
// Database key format: "roomId|eventType|stateKey"
|
||||
let roomAvatarDatabaseKey = [roomId, "m.room.avatar", ""].joined(
|
||||
separator: "|"
|
||||
)
|
||||
let roomAvatarResult = try database.executeQuery(
|
||||
"SELECT * FROM box_preload_room_states WHERE k=?",
|
||||
values: [roomAvatarDatabaseKey]
|
||||
)
|
||||
if roomAvatarResult.next(),
|
||||
let event = roomAvatarResult.string(forColumn: "v")
|
||||
{
|
||||
let roomAvatarEvent = try! JSONDecoder().decode(
|
||||
RoomAvatarEventJson.self,
|
||||
from: event.data(using: .utf8)!
|
||||
)
|
||||
if let avatarUrl = roomAvatarEvent.content.url, !avatarUrl.isEmpty {
|
||||
return avatarUrl
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
os_log(
|
||||
"[FluffyChatPushHelper] DB query failed: %{public}@",
|
||||
log: .default,
|
||||
type: .error,
|
||||
error.localizedDescription
|
||||
)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func getRoomNameFromDatabase(database: FMDatabase, roomId: String)
|
||||
-> String?
|
||||
{
|
||||
do {
|
||||
// Database key format: "roomId|eventType|stateKey"
|
||||
let roomNameDatabaseKey = [roomId, "m.room.name", ""].joined(
|
||||
separator: "|"
|
||||
)
|
||||
let roomNameResult = try database.executeQuery(
|
||||
"SELECT * FROM box_preload_room_states WHERE k=?",
|
||||
values: [roomNameDatabaseKey]
|
||||
)
|
||||
if roomNameResult.next(),
|
||||
let event = roomNameResult.string(forColumn: "v")
|
||||
{
|
||||
let roomNameEvent = try! JSONDecoder().decode(
|
||||
RoomNameEventJson.self,
|
||||
from: event.data(using: .utf8)!
|
||||
)
|
||||
if let name = roomNameEvent.content.name, !name.isEmpty {
|
||||
return name
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
os_log(
|
||||
"[FluffyChatPushHelper] DB query failed: %{public}@",
|
||||
log: .default,
|
||||
type: .error,
|
||||
error.localizedDescription
|
||||
)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func getRoomheroesFromDatabase(database: FMDatabase, roomId: String)
|
||||
-> [UserEventJson]?
|
||||
{
|
||||
do {
|
||||
let roomResult = try database.executeQuery(
|
||||
"SELECT * FROM box_rooms WHERE k=?",
|
||||
values: [roomId]
|
||||
)
|
||||
if roomResult.next(),
|
||||
let roomJson = roomResult.string(forColumn: "v")
|
||||
{
|
||||
let room = try JSONDecoder().decode(
|
||||
RoomJson.self,
|
||||
from: roomJson.data(using: .utf8)!
|
||||
)
|
||||
let heroes = room.summary.heroes.map { hero in
|
||||
return getUserFromDatabase(
|
||||
database: database,
|
||||
userId: hero,
|
||||
roomId: roomId
|
||||
)
|
||||
}.compactMap { $0 }
|
||||
return heroes
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
} catch is DecodingError {
|
||||
return []
|
||||
} catch {
|
||||
os_log(
|
||||
"[FluffyChatPushHelper] DB query failed: %{public}@",
|
||||
log: .default,
|
||||
type: .error,
|
||||
error.localizedDescription
|
||||
)
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
func downloadAttachment(url: String, containerPath: URL) throws -> UNNotificationAttachment {
|
||||
let downloadDirectory = containerPath.appendingPathComponent("fluffychat_download_cache")
|
||||
|
||||
let mxcComponents = url.replacingOccurrences(of: "mxc://", with: "").split(separator: "/")
|
||||
guard mxcComponents.count == 2 else {
|
||||
throw NSError(domain: "FamedlyPushHelper", code: 1, userInfo: [NSLocalizedDescriptionKey: "Invalid MXC URL format"])
|
||||
}
|
||||
|
||||
let host = String(mxcComponents[0]).replacingOccurrences(of: ".", with: "_")
|
||||
let mediaId = String(mxcComponents[1])
|
||||
let fileName = "notification_\(host)_\(mediaId).jpg"
|
||||
let fileUrl = downloadDirectory.appendingPathComponent(fileName)
|
||||
|
||||
return try UNNotificationAttachment(identifier: "image", url: fileUrl, options: nil)
|
||||
}
|
||||
}
|
||||
|
||||
struct UserEventJson: Decodable {
|
||||
struct UserEventContentJson: Decodable {
|
||||
let displayname: String?
|
||||
let avatar_url: String?
|
||||
}
|
||||
let content: UserEventContentJson
|
||||
}
|
||||
|
||||
struct RoomNameEventJson: Decodable {
|
||||
struct RoomNameEventContentJson: Decodable {
|
||||
let name: String?
|
||||
}
|
||||
let content: RoomNameEventContentJson
|
||||
}
|
||||
|
||||
struct RoomAvatarEventJson: Decodable {
|
||||
struct RoomAvatarEventContentJson: Decodable {
|
||||
let url: String?
|
||||
}
|
||||
let content: RoomAvatarEventContentJson
|
||||
}
|
||||
|
||||
struct RoomJson: Decodable {
|
||||
struct RoomSummaryJson: Decodable {
|
||||
let heroes: [String]
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case heroes = "m.heroes"
|
||||
}
|
||||
}
|
||||
let summary: RoomSummaryJson
|
||||
}
|
||||
|
||||
struct NotificationDevice: Decodable {
|
||||
struct NotificationDeviceData: Decodable {
|
||||
let client_name: String?
|
||||
}
|
||||
let data: NotificationDeviceData
|
||||
}
|
||||
struct NotificationCounts: Decodable {
|
||||
let unread: Int?
|
||||
}
|
||||
71
ios/Podfile
Normal file
@@ -0,0 +1,71 @@
|
||||
# Uncomment this line to define a global platform for your project
|
||||
platform :ios, '15.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
||||
project 'Runner', {
|
||||
'Debug' => :debug,
|
||||
'Profile' => :release,
|
||||
'Release' => :release,
|
||||
}
|
||||
|
||||
def flutter_root
|
||||
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
|
||||
unless File.exist?(generated_xcode_build_settings_path)
|
||||
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
|
||||
end
|
||||
|
||||
File.foreach(generated_xcode_build_settings_path) do |line|
|
||||
matches = line.match(/FLUTTER_ROOT\=(.*)/)
|
||||
return matches[1].strip if matches
|
||||
end
|
||||
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
|
||||
end
|
||||
|
||||
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
|
||||
|
||||
flutter_ios_podfile_setup
|
||||
|
||||
target 'Runner' do
|
||||
use_frameworks!
|
||||
use_modular_headers!
|
||||
|
||||
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
||||
|
||||
# From package https://pub.dev/packages/receive_sharing_intent
|
||||
target 'FluffyChat Share' do
|
||||
inherit! :search_paths
|
||||
end
|
||||
end
|
||||
|
||||
# SQLCipher for the NSE only:
|
||||
target 'Notification Service Extension' do
|
||||
use_frameworks! :linkage => :static
|
||||
use_modular_headers!
|
||||
pod 'FMDB/SQLCipher'
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
flutter_additional_ios_build_settings(target)
|
||||
target.build_configurations.each do |config|
|
||||
# ensure all dependencies are using SQLCipher instead of SQLite
|
||||
xcconfig_path = config.base_configuration_reference.real_path
|
||||
xcconfig = File.read(xcconfig_path)
|
||||
new_xcconfig = xcconfig.sub(' -l"sqlite3"', '')
|
||||
File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
|
||||
|
||||
config.build_settings['ENABLE_BITCODE'] = 'NO'
|
||||
|
||||
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
|
||||
|
||||
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
|
||||
'$(inherited)',
|
||||
# dart: PermissionGroup.microphone
|
||||
'PERMISSION_MICROPHONE=1',
|
||||
]
|
||||
end
|
||||
end
|
||||
flutter_post_install(installer) if defined?(flutter_post_install)
|
||||
end
|
||||
1163
ios/Runner.xcodeproj/project.pbxproj
Normal file
7
ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "cryptoswift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/krzyzanowskim/CryptoSwift.git",
|
||||
"state" : {
|
||||
"revision" : "f2a627b84c1ff96f21ac2fcb623ab36142dd5512",
|
||||
"version" : "1.10.0"
|
||||
}
|
||||
}
|
||||
],
|
||||
"version" : 2
|
||||
}
|
||||
112
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
Normal file
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1510"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<PreActions>
|
||||
<ExecutionAction
|
||||
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
|
||||
<ActionContent
|
||||
title = "Run Prepare Flutter Framework Script"
|
||||
scriptText = "/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" prepare ">
|
||||
<EnvironmentBuildable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</EnvironmentBuildable>
|
||||
</ActionContent>
|
||||
</ExecutionAction>
|
||||
</PreActions>
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
enableGPUValidationMode = "1"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Profile"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
10
ios/Runner.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreviewsEnabled</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
14
ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "cryptoswift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/krzyzanowskim/CryptoSwift.git",
|
||||
"state" : {
|
||||
"revision" : "f2a627b84c1ff96f21ac2fcb623ab36142dd5512",
|
||||
"version" : "1.10.0"
|
||||
}
|
||||
}
|
||||
],
|
||||
"version" : 2
|
||||
}
|
||||
18
ios/Runner/AppDelegate.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
|
||||
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
|
||||
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
|
||||
|
||||
// From https://pub.dev/packages/flutter_local_notifications#-ios-setup
|
||||
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate }
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"images":[{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@3x.png","scale":"3x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@3x.png","scale":"3x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@3x.png","scale":"3x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@1x.png","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@3x.png","scale":"3x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@1x.png","scale":"1x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@1x.png","scale":"1x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@1x.png","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@2x.png","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@1x.png","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@2x.png","scale":"2x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@1x.png","scale":"1x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@2x.png","scale":"2x"},{"size":"83.5x83.5","idiom":"ipad","filename":"Icon-App-83.5x83.5@2x.png","scale":"2x"},{"size":"1024x1024","idiom":"ios-marketing","filename":"Icon-App-1024x1024@1x.png","scale":"1x"}],"info":{"version":1,"author":"xcode"}}
|
||||
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 692 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
23
ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
BIN
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
vendored
Normal file
|
After Width: | Height: | Size: 68 B |
BIN
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 68 B |
BIN
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 68 B |
5
ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Launch Screen Assets
|
||||
|
||||
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
|
||||
|
||||
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
|
||||
37
ios/Runner/Base.lproj/LaunchScreen.storyboard
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="LaunchImage" width="168" height="185"/>
|
||||
</resources>
|
||||
</document>
|
||||
26
ios/Runner/Base.lproj/Main.storyboard
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Flutter View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
34
ios/Runner/GoogleService-Info.plist
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CLIENT_ID</key>
|
||||
<string>865731724731-ofdr7e6m04murgb1bvchlj9oaos0q5i3.apps.googleusercontent.com</string>
|
||||
<key>REVERSED_CLIENT_ID</key>
|
||||
<string>com.googleusercontent.apps.865731724731-ofdr7e6m04murgb1bvchlj9oaos0q5i3</string>
|
||||
<key>API_KEY</key>
|
||||
<string>AIzaSyA8ZUBcuny0HjPwF2Q2fvDyQTC5dG2VHlE</string>
|
||||
<key>GCM_SENDER_ID</key>
|
||||
<string>865731724731</string>
|
||||
<key>PLIST_VERSION</key>
|
||||
<string>1</string>
|
||||
<key>BUNDLE_ID</key>
|
||||
<string>im.fluffychat.app</string>
|
||||
<key>PROJECT_ID</key>
|
||||
<string>fluffychat-ef3e8</string>
|
||||
<key>STORAGE_BUCKET</key>
|
||||
<string>fluffychat-ef3e8.appspot.com</string>
|
||||
<key>IS_ADS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_ANALYTICS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_APPINVITE_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_GCM_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_SIGNIN_ENABLED</key>
|
||||
<true></true>
|
||||
<key>GOOGLE_APP_ID</key>
|
||||
<string>1:865731724731:ios:79fd983ce46cb40c64309e</string>
|
||||
</dict>
|
||||
</plist>
|
||||
138
ios/Runner/Info.plist
Normal file
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
||||
<array>
|
||||
<string>im.fluffychat.app</string>
|
||||
</array>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>FluffyChat</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>fluffychat</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>im.fluffychat.app.uris</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>ShareMedia-$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<string>im.fluffychat</string>
|
||||
<string>matrix</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSAppleMusicUsageDescription</key>
|
||||
<string>Play audio and voice messages in the app.</string>
|
||||
<key>NSBluetoothAlwaysUsageDescription</key>
|
||||
<string>Play audio and voice messages via bluetooth devices.</string>
|
||||
<key>NSBluetoothPeripheralUsageDescription</key>
|
||||
<string>Play audio and voice messages on bluetooth devices</string>
|
||||
<key>NSCalendarsUsageDescription</key>
|
||||
<string>Share calendar dates with your contacts in FluffyChat.</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Open the camera and take a picture to share them with your contacts on FluffyChat.</string>
|
||||
<key>NSContactsUsageDescription</key>
|
||||
<string>Share contacts with your contacts in FluffyChat.</string>
|
||||
<key>NSFaceIDUsageDescription</key>
|
||||
<string>FluffyChat uses an app lock for an additional security level</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>Share your location with your contacts in FluffyChat.</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>Share your location with your contacts in FluffyChat.</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>Share your location with your contacts in FluffyChat.</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>Record voice message and share them with your contacts on FluffyChat.</string>
|
||||
<key>NSMotionUsageDescription</key>
|
||||
<string>Share motions with your contacts in FluffyChat.</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>Open photos from your gallery and share them with your contacts on FluffyChat.</string>
|
||||
<key>NSSpeechRecognitionUsageDescription</key>
|
||||
<string>Share data with your contacts in FluffyChat.</string>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>voip</string>
|
||||
<string>audio</string>
|
||||
<string>fetch</string>
|
||||
<string>processing</string>
|
||||
<string>remote-notification</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIStatusBarHidden</key>
|
||||
<false/>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>io.flutter.embedded_views_preview</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict>
|
||||
<key>UIWindowSceneSessionRoleApplication</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UISceneClassName</key>
|
||||
<string>UIWindowScene</string>
|
||||
<key>UISceneDelegateClassName</key>
|
||||
<string>FlutterSceneDelegate</string>
|
||||
<key>UISceneConfigurationName</key>
|
||||
<string>flutter</string>
|
||||
<key>UISceneStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
1
ios/Runner/Runner-Bridging-Header.h
Normal file
@@ -0,0 +1 @@
|
||||
#import "GeneratedPluginRegistrant.h"
|
||||
16
ios/Runner/Runner.entitlements
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
<key>com.apple.developer.associated-domains</key>
|
||||
<array>
|
||||
<string>applinks:example.com</string>
|
||||
</array>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.im.fluffychat.app</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
1
ios/Runner/ar.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/ar.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/ca.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/ca.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/cs.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/cs.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/de.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/de.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/eo.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/eo.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/es.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/es.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/et.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/et.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/eu.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/eu.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/fr.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/fr.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/gl.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/gl.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/hr-HR.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/hr-HR.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/hu-HU.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/hu-HU.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/hu.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/hu.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/hy.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/hy.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/it.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/it.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/ja.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/ja.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/nb-NO.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/nb-NO.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
BIN
ios/Runner/notification.caf
Normal file
1
ios/Runner/pl.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/pl.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/pt.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/pt.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/ru-RU.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/ru-RU.lproj/Main.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
ios/Runner/sk-SK.lproj/LaunchScreen.strings
Normal file
@@ -0,0 +1 @@
|
||||
|
||||