Skip to content

Commit

Permalink
refactor: Add stub headers for bad plugin extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed Aug 15, 2024
1 parent 742add6 commit c0aa1a2
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
90EB303C2C6DD83300CEEB2F /* build-extras.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-extras.xcconfig"; path = "cordova/build-extras.xcconfig"; sourceTree = SOURCE_ROOT; };
90EB303F2C6DD87600CEEB2F /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-debug.xcconfig"; path = "cordova/build-debug.xcconfig"; sourceTree = SOURCE_ROOT; };
90EB30402C6DD87600CEEB2F /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-release.xcconfig"; path = "cordova/build-release.xcconfig"; sourceTree = SOURCE_ROOT; };
90F7E7002C6EB78900AD84C2 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
90F7E7012C6EB78900AD84C2 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -186,7 +188,9 @@
907F98552C06B87200D2D242 /* PrivacyInfo.xcprivacy */,
907F98622C06B97000D2D242 /* Entitlements-Debug.plist */,
907F98632C06B9C800D2D242 /* Entitlements-Release.plist */,
90F7E7002C6EB78900AD84C2 /* AppDelegate.h */,
9040B1872C6DD3EB00662C5D /* Bridging-Header.h */,
90F7E7012C6EB78900AD84C2 /* MainViewController.h */,
907F98542C06B85800D2D242 /* Plugins */,
905D2F6D2C6DDEE100117937 /* Resources */,
9080B40D2C6DD79000078F33 /* config */,
Expand Down
27 changes: 27 additions & 0 deletions templates/project/__PROJECT_NAME__/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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 <Cordova/CDVAppDelegate.h>

#warning It is unsafe to rely on the AppDelegate class as an extension point. \
Update your code to extend CDVAppDelegate instead -- \
This code will stop working in Cordova iOS 9!

@interface AppDelegate : CDVAppDelegate
@end
1 change: 1 addition & 0 deletions templates/project/__PROJECT_NAME__/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import UIKit
import Cordova

@main
@objc // Remove compat hack in Cordova iOS 9
class AppDelegate: CDVAppDelegate {
override func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
Expand Down
27 changes: 27 additions & 0 deletions templates/project/__PROJECT_NAME__/MainViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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 <Cordova/CDVViewController.h>

#warning It is unsafe to rely on the MainViewController class as an extension point. \
Update your code to extend CDVViewController instead -- \
This code will stop working in Cordova iOS 9!

@interface MainViewController : CDVViewController
@end
1 change: 1 addition & 0 deletions templates/project/__PROJECT_NAME__/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import Cordova

@objc(MainViewController) // Remove compat hack in Cordova iOS 9
class ViewController: CDVViewController {
}

0 comments on commit c0aa1a2

Please sign in to comment.