diff --git a/sdk/qrcode/ios/sdk.bundle/resolutions.csv b/sdk/qrcode/ios/sdk.bundle/resolutions.csv new file mode 100644 index 00000000..84cc2ec8 --- /dev/null +++ b/sdk/qrcode/ios/sdk.bundle/resolutions.csv @@ -0,0 +1,58 @@ +identifier,device_name,dpis +iPhone1.1,iPhone,326.0f +iPhone1.2,iPhone 3G,326.0f +iPhone2.1,iPhone 3Gs,326.0f +iPhone3.1,iPhone 4,326.0f +iPhone3.2,iPhone 4,326.0f +iPhone3.3,iPhone 4,326.0f +iPhone4.1,iPhone 4s,326.0f +iPhone4.2,iPhone 4s,326.0f +iPhone5.1,iPhone 5,326.0f +iPhone5.2,iPhone 5,326.0f +iPhone5.3,iPhone 5c,326.0f +iPhone5.4,iPhone 5c,326.0f +iPhone6.1,iPhone 5s,326.0f +iPhone6.2,iPhone 5s,326.0f +iPhone7.1,iPhone 6 Plus,401.0f +iPhone7.2,iPhone 6,326.0f +iPhone8.1,iPhone 6s,326.0f +iPhone8.2,iPhone 6s Plus,401.0f +iPhone8.4,iPhone SE,326.0f +iPhone9.1,iPhone 7,326.0f +iPhone9.2,iPhone 7 Plus,401.0f +iPhone9.3,iPhone 7,326.0f +iPhone9.4,iPhone 7 Plus,401.0f +iPhone10.1,iPhone 8,326.0f +iPhone10.2,iPhone 8 Plus,401.0f +iPhone10.3,iPhone X,458.0f +iPhone10.4,iPhone 8,326.0f +iPhone10.5,iPhone 8 Plus,401.0f +iPhone10.6,iPhone X,458.0f +iPhone11.2,iPhone Xs,458.0f +iPhone11.4,iPhone Xs Max,456.0f +iPhone11.6,iPhone Xs Max,456.0f +iPhone11.8,iPhone Xr,456.0f +iPhone12.1,iPhone 11,326.0f +iPhone12.3,iPhone 11 Pro,458.0f +iPhone12.5,iPhone 11 Pro Max,458.0f +iPhone13.1,iPhone 12 Mini,476.0f +iPhone13.2,iPhone 12,460.0f +iPhone13.3,iPhone 12 Pro,460.0f +iPhone13.4,iPhone 12 Pro Max,458.0f +iPhone14.4,iPhone 13 Mini,476.0f +iPhone14.5,iPhone 13,460.0f +iPhone14.2,iPhone 13 Pro,460.0f +iPhone14.3,iPhone 13 Pro Max,458.0f +iPhone14.7,iPhone 14,460.0f +iPhone14.8,iPhone 14 Plus,458.0f +iPhone15.2,iPhone 14 Pro,460.0f +iPhone15.3,iPhone 14 Pro Max,460.0f +iPhone15.4,iPhone 15,460.0f +iPhone15.5,iPhone 15 Plus,460.0f +iPhone16.1,iPhone 15 Pro,460.0f +iPhone16.2,iPhone 15 Pro Max,460.0f +iPhone17.3,iPhone 16,460.0f +iPhone17.4,iPhone 16 Plus,460.0f +iPhone17.1,iPhone 16 Pro,460.0f +iPhone17.2,iPhone 16 Pro Max,460.0f +iPod9.1,iPod touch (7th generation),326.0f \ No newline at end of file diff --git a/sdk/screen_params/ios/sdk_bundle_finder.h b/sdk/screen_params/ios/sdk_bundle_finder.h new file mode 100644 index 00000000..bc70de90 --- /dev/null +++ b/sdk/screen_params/ios/sdk_bundle_finder.h @@ -0,0 +1,39 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef CARDBOARD_SDK_SCREEN_PARAMS_IOS_SDK_BUNDLE_FINDER_H_ +#define CARDBOARD_SDK_SCREEN_PARAMS_IOS_SDK_BUNDLE_FINDER_H_ + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * A helper class to get the SDK bundle path. + */ +@interface SDKBundleFinder : NSObject + +/** + * Gets the current SDK bundle. + * @return The SDK bundle. + */ +- (nullable NSBundle *)getSDKBundle; + +@end + +NS_ASSUME_NONNULL_END + +#endif // CARDBOARD_SDK_SCREEN_PARAMS_IOS_SDK_BUNDLE_FINDER_H_ diff --git a/sdk/screen_params/ios/sdk_bundle_finder.mm b/sdk/screen_params/ios/sdk_bundle_finder.mm new file mode 100644 index 00000000..9856d584 --- /dev/null +++ b/sdk/screen_params/ios/sdk_bundle_finder.mm @@ -0,0 +1,32 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#import "screen_params/ios/sdk_bundle_finder.h" +#import "util/logging.h" + +@implementation SDKBundleFinder + +- (nullable NSBundle *)getSDKBundle { + NSBundle *thisBundle = [NSBundle bundleForClass:[self class]]; + NSString *sdkBundlePath = [thisBundle pathForResource:@"sdk" ofType:@"bundle"]; + if (!sdkBundlePath) { + // We must be in the sdk bundle as there is no resource bundle under us. + return thisBundle; + } + + return [NSBundle bundleWithPath:sdkBundlePath]; +} + +@end