Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5790196

Browse files
author
Chris Yang
committed
fix
1 parent d64abdb commit 5790196

File tree

29 files changed

+1122
-3
lines changed

29 files changed

+1122
-3
lines changed

shell/platform/darwin/common/framework/Source/FlutterNSBundleUtils.mm

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,23 @@
6161
NSString* flutterAssetsPath = FLTAssetPath(bundle);
6262
// Use the raw path solution so that asset path can be returned from unloaded bundles.
6363
// See https://github.com/flutter/engine/pull/46073
64-
NSString* assetsPath = [bundle pathForResource:flutterAssetsPath ofType:@""];
64+
NSString* assetsPath = [bundle pathForResource:flutterAssetsPath ofType:nil];
65+
if (assetsPath.length == 0) {
66+
// In app_extension, using full relative path: kDefaultAssetPath
67+
// returns nil because the app bundle is not loaded. We try to use
68+
// the sub folder name, which can successfully return a valid path.
69+
assetsPath = [bundle pathForResource:@"flutter_assets" ofType:nil];
70+
}
71+
72+
if (assetsPath.length == 0) {
73+
assetsPath = [[NSBundle mainBundle] pathForResource:flutterAssetsPath ofType:nil];
74+
}
6575

6676
if (assetsPath.length == 0) {
67-
assetsPath = [[NSBundle mainBundle] pathForResource:flutterAssetsPath ofType:@""];
77+
// In app_extension, using full relative path: kDefaultAssetPath
78+
// returns nil because the app bundle is not loaded. We try to use
79+
// the sub folder name, which can successfully return a valid path.
80+
assetsPath = [[NSBundle mainBundle] pathForResource:@"flutter_assets" ofType:nil];
6881
}
6982
return assetsPath;
7083
}

testing/scenario_app/ios/FlutterAppExtensionTestHost/FlutterAppExtensionTestHost.xcodeproj/project.pbxproj

Lines changed: 372 additions & 0 deletions
Large diffs are not rendered by default.

testing/scenario_app/ios/FlutterAppExtensionTestHost/FlutterAppExtensionTestHost.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright 2018 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#import <UIKit/UIKit.h>
6+
7+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
8+
9+
@end
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2018 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
#import "AppDelegate.h"
5+
6+
@interface AppDelegate ()
7+
8+
@end
9+
10+
@implementation AppDelegate
11+
12+
- (BOOL)application:(UIApplication*)application
13+
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
14+
// Override point for customization after application launch.
15+
return YES;
16+
}
17+
18+
#pragma mark - UISceneSession lifecycle
19+
20+
- (UISceneConfiguration*)application:(UIApplication*)application
21+
configurationForConnectingSceneSession:(UISceneSession*)connectingSceneSession
22+
options:(UISceneConnectionOptions*)options {
23+
// Called when a new scene session is being created.
24+
// Use this method to select a configuration to create the new scene with.
25+
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration"
26+
sessionRole:connectingSceneSession.role];
27+
}
28+
29+
- (void)application:(UIApplication*)application
30+
didDiscardSceneSessions:(NSSet<UISceneSession*>*)sceneSessions {
31+
// Called when the user discards a scene session.
32+
// If any sessions were discarded while the application was not running, this will be called
33+
// shortly after application:didFinishLaunchingWithOptions. Use this method to release any
34+
// resources that were specific to the discarded scenes, as they will not return.
35+
}
36+
37+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"platform" : "ios",
6+
"size" : "1024x1024"
7+
}
8+
],
9+
"info" : {
10+
"author" : "xcode",
11+
"version" : 1
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
5+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
7+
</dependencies>
8+
<scenes>
9+
<!--View Controller-->
10+
<scene sceneID="EHf-IW-A2E">
11+
<objects>
12+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
13+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
14+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
15+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
16+
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
17+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
18+
</view>
19+
</viewController>
20+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
21+
</objects>
22+
<point key="canvasLocation" x="53" y="375"/>
23+
</scene>
24+
</scenes>
25+
</document>

0 commit comments

Comments
 (0)