Iphone Application has got rejected many times - iphone

Iphone Application has got rejected many times. I am not find correct issue.
These are following issue in symbolicate
Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0
Crashed: 0 talentrack 0x00000001000c5b18
specialized AppDelegate.application(UIApplication,
didFinishLaunchingWithOptions : [NSObject : AnyObject]?) -> Bool
(AppDelegate.swift:102) 1 talentrack
0x00000001000c29e4 #objc AppDelegate.application(UIApplication,
didFinishLaunchingWithOptiKons : [NSObject : AnyObject]?) -> Bool
(AppDelegate.swift:0)

Related

Why does editing a textField throw a NSInvalidArgumentException?

Xcode 13.0, Swift 5.5, iOS 15.0.2
Please bare with my poor debugging skills.
As soon as I try to type something in a textfield in my app, it throws a NSInvalidArgumentException and the log prints:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[__NSSingleObjectArrayI stringByTrimmingCharactersInSet:]:
unrecognized selector sent to instance 0x281a074b0'
*** First throw call stack:
(0x18535dcac 0x19c3cc758 0x18542d6d0 0x1852f7edc 0x1852f714c 0x187777400 0x187b22ee8
0x10566e1c8 0x10566fb1c 0x18777ac48 0x187c02f50 0x10566e1c8 0x10566fb1c 0x187699e84
0x187699ce8 0x187698b58 0x187b173fc 0x10566e1c8 0x10566fb1c 0x187b9f0d4 0x1884cf17c
0x1884db210 0x1884dacd8 0x1884ce794 0x1884cd90c 0x1884dc0ec 0x1884dc0ec 0x1884dc0ec
0x1884dc0ec 0x1884dc0ec 0x1884dc0ec 0x1884dc0ec 0x1884dc0ec 0x1884dc0ec 0x1884dc0ec
0x1884dc0ec 0x1884dc0ec 0x1884dc0ec 0x1884dc0ec 0x1884dc0ec 0x1884dc0ec 0x1884dc0ec
0x1884cd978 0x18830689c 0x18826cc74 0x18830f8c4 0x18830f9d4 0x187ba4a70 0x187a5bfd4
0x18777d948 0x18830f60c 0x18779486c 0x1877c472c 0x187969160 0x187799380 0x18778e130
0x18779365c 0x18537e220 0x18538e248 0x1852d15e8 0x1852d6a18 0x1852e9d8c 0x19f3f69a0
0x187b1efa8 0x1878b322c 0x19b4f3e80 0x104486c24 0x104844190)
libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
I set a symbolic breakpoint at -[__NSSingleObjectArrayI stringByTrimmingCharactersInSet:] as described here (How can I debug 'unrecognized selector sent to instance' error). But this breakpoint isn't reached, as far as I can tell(?)
From the Xcode Debug navigator, the app crashes here: #68 0x0000000104486bd4 in static AppDelegate.$main() [inlined], as per line 9:
MyApp`main:
9. 0x104486bd4 <+28>: bl 0x10451bbd0 ; symbol stub for: static Swift.CommandLine.unsafeArgv.getter : Swift.UnsafeMutablePointer<Swift.Optional<Swift.UnsafeMutablePointer<Swift.Int8>>>
My AppDelegate:
import UIKit
import Firebase
import FirebaseUI
import FBSDKCoreKit
#main
class AppDelegate: UIResponder, UIApplicationDelegate {
var orientationLock = UIInterfaceOrientationMask.all
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return self.orientationLock
}
struct AppUtility {
static func lockOrientation(_ orientation: UIInterfaceOrientationMask) {
if let delegate = UIApplication.shared.delegate as? AppDelegate {
delegate.orientationLock = orientation
}
}
static func lockOrientation(_ orientation: UIInterfaceOrientationMask, andRotateTo rotateOrientation:UIInterfaceOrientation) {
self.lockOrientation(orientation)
UIDevice.current.setValue(rotateOrientation.rawValue, forKey: "orientation")
}
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//Initialize and configure Firebase
FirebaseApp.configure()
// Initialize Facebook SDK
ApplicationDelegate.shared.application(application,didFinishLaunchingWithOptions: launchOptions)
return true
}
func application(_ app: UIApplication, open url: URL, options: UIApplication.OpenURLOptionsKey : Any]) -> Bool {
let sourceApplication = options[UIApplication.OpenURLOptionsKey.sourceApplication] as! String?
// FirebaseUI URL handling
if FUIAuth.defaultAuthUI()?.handleOpen(url, sourceApplication: sourceApplication) ?? false {
return true
}
// other URL handling goes here.
return false
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
func applicationWillTerminate(_ application: UIApplication) {}
}
When placing the marker in the textField, before starting to type, the log prints Writing analzed variants.
I never saw this before but according to this (Xcode log "Writing analzed variants") it can be ignored.
I'm also seing this in the log upon launching the app, which I've never seen before. Don't know if it's of any help:
[] __nwlog_err_simulate_crash simulate crash already simulated "nw_hash_table_apply called with null table"
[] nw_hash_table_apply called with null table, dumping backtrace:
[arm64] libnetcore-2736.12.1
0 libnetwork.dylib 0x00000001867cb2f0 __nw_create_backtrace_string + 116
1 libnetwork.dylib 0x0000000185fa9820 nw_hash_table_apply + 2676
2 libnetwork.dylib 0x00000001864f4450 EE6D5599-5B6E-3AAC-ABC7-05F56B4EE2FB + 6030416
3 libnetwork.dylib 0x00000001864d0a9c EE6D5599-5B6E-3AAC-ABC7-05F56B4EE2FB + 5884572
4 CFNetwork 0x0000000185ce152c _CFURLStorageSessionCopyIdentifier + 14364
5 libnetwork.dylib 0x00000001860c3eb8 EE6D5599-5B6E-3AAC-ABC7-05F56B4EE2FB + 1638072
6 libdispatch.dylib 0x00000001032d494c _dispatch_call_block_and_release + 24
7 libdispatch.dylib 0x00000001032d61c8 _dispatch_client_callout + 16
8 libdispatch.dylib 0x00000001032df560 _dispatch_workloop_invoke + 2448
9 libdispatch.dylib 0x00000001032e9630 _dispatch_workloop_worker_thread + 852
10 libsystem_pthread.dylib 0x00000001dece2f38 _pthread_wqthread + 284
11 libsystem_pthread.dylib 0x00000001dece2aa4 start_wqthread + 8
UPDATE - TEXTFIELD CONFIG
The issue is for all textfields in the app, even the email address textfield in FirebaseUI (which I don't configure manually at all). This makes me think it's not about the textfield config, but rather a keyboard issue? Can that make sense and how can I debug that?
Anyway, the textfields I create are created in storyboard. In each viewController I have a few delegate methods; textFieldDidBeginEditing(_:), textFieldShouldReturn(_:) and textFieldDidEndEditing(_:). I can tell the textFieldDidBeginEditing is being called when the user taps the textfield. But then, as soon as the first keyboard letter is pressed, the exception is thrown.
The keyboard is default and the textField contentType is unspecified. Don't know if that is relevant or not.
UPDATE
I have done nothing with my code, but after updating to iOS 15.2 the error is gone!? Any ideas?

Flutter: iOS notification background handler

How to handle iOS background notification click_action when it is null ?
{
"to" : "abcd1234",
"collapse_key" : "type_a",
"notification" : {
"title": "Testing",
"body" : "Testing 1 2 3 4 5 6 7"
},
"data" : {
"click_action": "FLUTTER_NOTIFICATION_CLICK",
"route": "/Home",
}
}
onBackgroundMessage: Platform.isAndroid ? BackgroundHandler.backgroundHandler : null
This post mentioned onBackgroundMessage not implemented in iOS just use for android. Is there a way to handle in iOS ? Thanks.
Yes.
If you did all the ios firebase configurations using XCode, you can use the native swift functions to listen to the background notifications on iOS.
Inside your AppDelegate class,
override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {
}
override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: #escaping (UIBackgroundFetchResult) -> Void) {
/// Here you will get the silent background notification .
/// May be you can call you flutter code from here if you need.
/// Make sure that you end your processing quickly, else you will not get the background notification regularly and timely from iOS.
/// After you completed, make sure you call the completionHandler so that iOS knows you are done with your background task and you completed it so quickly.
completionHandler(UIBackgroundFetchResult.newData)
}
FlutterFire team is working on this to bring to the flutter side and you can expect this very soon I think by looking at their GitHub PRs.

EXC_BAD_ACCESS, KERN_PROTECTION_FAILURE preview on Xcode 11 using SwiftUI

As soon as I try to preview my code, it crashes with these errors. I already posted something else on this matter but seems to be connected. As soon as one file crashed, all the others followed.
Any ideas?
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007ffee4b53ff0
Exception Note: EXC_CORPSE_NOTIFY
External Modification Warnings:
Thread creation by external task.
VM Regions Near 0x7ffee4b53ff0:
MALLOC_LARGE 00007fb8683d3000-00007fb8683f4000 [ 132K] rw-/rwx SM=PRV
--> STACK GUARD 00007ffee1354000-00007ffee4b54000 [ 56.0M] ---/rwx SM=NUL stack guard for thread 0
Stack 00007ffee4b54000-00007ffee5354000 [ 8192K] rw-/rwx SM=ALI thread 0
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libswiftCore.dylib 0x00007fff512e9a86 swift_getGenericMetadata + 102
1 com.apple.AttributeGraph 0x00007fff2fc601cd __swift_instantiateGenericMetadata + 29
2 com.apple.AttributeGraph 0x00007fff2fc61d1d protocol witness for static Formula.add(_:to:) in conformance Formulas.Offset<A, B> + 77
3 com.apple.SwiftUI 0x00007fff2c378b3f closure #1 in static AGGraphRef.<< infix<A>(_:_:) + 15
4 com.apple.SwiftUI 0x00007fff2c378bef thunk for #callee_guaranteed (#unowned UnsafePointer<A>) -> (#unowned Attribute<A.Value>, #error #owned Error) + 15
EDIT:
import UIKit
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// MARK: UISceneSession Lifecycle
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
import SwiftUI
struct PisteRow: View {
var pista: Structure
var body: some View {
HStack {
padding()
pista.image
.resizable()
.frame(width: 50, height: 50)
.clipShape(Circle())
Text(pista.name)
Spacer()
}
}
}
struct PisteRow_Previews: PreviewProvider {
static var previews: some View {
PisteRow(pista: pisteData[0])
.previewLayout(.fixed(width: 300, height: 70))
}
}
These are the files requested, App Delegate and the SwiftUI File that won't allow preview. Thanks.

Swift Local Notifications: Type Of Expression is Ambiguous Without More Context

I'm attempting to implement local notifications and am getting the error "Type of Expression is Ambiguous without More Context".
I've looked other related topics and many of them were either using an earlier version of Xcode (I'm using 8.o, ios 10) or provided the same piece of code I'm having issues with as a result. I apologize if I missed a post with the answer. I've copied and pasted this code from a tutorial site, which seems to be the same code used on many other sites (and provided as an answer to other issues).
This code is meant to ask for permission for local notifications from the user
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
application.registerUserNotificationSettings(UNNotificationSettings(forTypes: [.Alert , .Badge , .Sound], categories: nil)) // This line sends back the error
return true
}
Thank you!
As per Swift 3 & iOS 10, do the following:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound], completionHandler: nil)
return true
}

PFFacebookUtils.logInInBackgroundWithReadPermissions block returns user = nil and error = nil

I have an iOS 9 app (Xcode 7.1, Swift 2.0) with the following pods, using the latest versions at the time of this post:
pod 'Parse' (using latest version 1.12.0)
pod 'ParseFacebookUtilsV4' (using latest version 1.11.0)
I am attempting to run the following code:
let permissions = ["public_profile", "email"]
PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) {
(user, error) in
// Both user and error are nil here
}
But I always get a nil user and a nil error. The login worked a couple months ago, but all of a sudden (I believe after a pod update), the login stopped working.
I have added all the proper plist entries as described on the Facebook developers site, and I have added all the appropriate functions in the app delegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
return true
}
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
let sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey] as? String
return FBSDKApplicationDelegate.sharedInstance().application(app, openURL: url, sourceApplication: sourceApplication, annotation: nil)
}
func applicationDidBecomeActive(application: UIApplication) {
FBSDKAppEvents.activateApp()
}
in AppDelegate, under didFinishLaunchingWithOptions initialize Parse before initializing PFFacebookUtils. I was making the same mistake