twitter sharing using sharekit crashing in ios 5 - ios

Hi I'm trying to a share images using sharekit on twitter,from app. I have added a twitter icon and when clicked I call this function
-(void)shareTwitter
{
SHKItem *itemshare = [SHKItem image:imgView.image title:projectname];
[SHK setRootViewController:self.navigationController];
[SHKTwitter shareItem:itemshare];
}
after this function is executed the app crashes saying exec_bad_access in sharekit code.
I have added the piece of line below where it occurs.
iOS5twitter.completionHandler = ^(TWTweetComposeViewControllerResult result) ;
I tried to reproduce the same issue with the demoapp provided by sharekit.The app runs fine and even posts image.
The crash appears before login authentication. can someone guide me thru this and help me fix this issue
thanks

Related

Appcelerator - share link on Facebook

I have problem sharing a link on Facebook in my app made with Appcelerator
I’m using iOS 11 Simulator, Titanium SDK 7.1 and Facebook Module 5.8.
My tiapp.xml should be correct.
The facebook app is not installed on the simulator.
My code is:
var fb = require('facebook');
fb.initialize();
function shareLink() {
fb.addEventListener('shareCompleted', onShareCompleted);
fb.presentShareDialog({
link: "http://www.google.com"
});
}
function onShareCompleted(e){
fb.removeEventListener('shareCompleted', onShareCompleted);
if (e.success) Ti.API.info('Share request succeeded.');
else Ti.API.info('Failed to share.' + JSON.stringify(e));
}
When I try to share, the app show me a webpage of facebook with the error “The parameter ‘href’ or ‘media’ is required”.
If I switch the Facebook module from version 5.8 to 5.6, the first time I try to share, it fails, but the second time it work!
I can’t understand where I’m wrong.
Thanks for any help!
Try this. Its super easy and I always use it for social sharing:
https://github.com/ricardoalcocer/socialshare/tree/master/app/widgets/com.alcoapps.socialshare

Apple Watch screen stays blank telerik

I use Telerik-AppleWatch plugin for cordova.
i followed the instructions and i copied the simplified example from the project.
when i run the project the Built successfully but on the iwatch i see just the name of the app and blank screen.
I didn't receive error on the console.
i use xcode. target is- 8.2
There is not much information on the internet about it
function initAppleWatch() {
applewatch.init(function () {
alert("init");
onAppRequestsUpdate();
onGlanceRequestsUpdate();
});
applewatch.callback.onLoadAppMainRequest = onAppRequestsUpdate;
applewatch.callback.onLoadGlanceRequest = onGlanceRequestsUpdate;
}
can anybody know what can i do?
I work on it all week without success
thanks!:)

your app loads indefinitely upon launch

I have an app which works fine on below devices.
iPhone 4s (iOS 7.1)
iPhone 5 (iOS 9.1)
iPhone 6 (iOS 9.1)
However app is rejecting saying below rejection.
We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 9.1 on both Wi-Fi and cellular networks.
App did not load its contents, did not load beyond the flash screen.
However when I run this from my side, its working fine but it has problem at Apple end only. I don't know how can app run at my end and its giving problem at Apple end only? I tried to upload with iOS 8.4, but still Apple reply still we can't go beyond splash screen.
Did anyone face such issue OR does anyone point me where I can be wrong?
I have uploaded 6 builds and all are rejected saying same reason.
Note: Same app was working fine earlier (before iOS 9.1 release), but when I try to upload now, it is giving this error.
The biggest challenge for me is, I don't know what is the problem, but I need to FIX this problem
Edit 1
I have first screen as language screen where I have animation of images.
animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1080, 1920)];
animationImageView.hidden = NO;
animationImageView.animationImages = mArray;
animationImageView.animationDuration = 1.5;
animationImageView.animationRepeatCount = 1;
[self.view addSubview:animationImageView];
[animationImageView startAnimating];
After testing on testflight, I found a problem.
If I open the app after clicking app icon, it was working fine.
The problem comes when I click Open button from testflight
When I click Open button, launchOptions in AppDelegate was not nil, so the code in push was going wrong and internally it was crashing but still app was hanged at splash screen (not sure why though)
Below is what I have when I print launchOptions in AppDelegate didFinishLaunchingWithOptions
launchOptions==={
UIApplicationLaunchOptionsSourceApplicationKey = "com.apple.TestFlight";
}
So I changed my code to below and all is working perfectly.
NSLog(#"launchOptions===%#", launchOptions);
if (launchOptions!=nil) {
NSMutableDictionary *userInfo = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
NSLog(#"userInfo===%#", userInfo);
NSLog(#"userInfo===%d", userInfo.count);
if (userInfo.count>=1) {
// here is my code on what to do if i click on push
}
}
Do let me know if someone is not clear
It was crashing saying below
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithString:]: nil argument'
So I feel problem was at line below.
NSString *badge =[[NSString alloc] initWithFormat:#"%#", [apsInfo objectForKey:#"badge"]];
But after putting above condition, all was working fine.
Did you test using "Run" from Xcode, or using Test Flight? Test Flight gets you the app in the same environment as Apple gets it, while running directly from Xcode may yield different results (different push notification environment, possibly different compilation options...).
Also, do you have access to the logs of the server that the app queries? If so, have you checked them to see what happens when Apple try to use the app? Is the query correctly formed? Was there an error (status code different from 200, or in the error log)?
What kind of request does your app perform? Is it a regular http(s) request? Or are you using an unusual protocol which may be blocked somehow?
I suppose the server queried is fully reachable from the Internet (i.e. you did not put a server that is only accessible on your local network)?
You should add error handling in your code, to test the result of requests and display information about it, so that if there's an error when they test it, at least they can report what the error is.

Why does not executing the following code cause it to crash?

I have an app that uses Admob. But since I am supporting versions of iOS 5 and above, I make sure that I don't call Admob code in versions below iOS 6 by doing the following:
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_5_1) {
int j = 2;
j++; //This is just some code so I can use breakpoints for testing.
NSLog(#"Google Mobile Ads SDK version: %#", [GADRequest sdkVersion]); //Commenting out the line prevents the crash
}
I am testing on iOS 5.1.1. Now if I comment out the NSLog, line, the app works without problem. But if I uncomment it the app crashes almost immediately within the main method:
int retVal = UIApplicationMain(argc, argv, nil, #"AppController");
I guess its not crashing when it is commented out because the compiler "optimises out" the code since its not used. But then what is the correct way to make sure the code isn't used, and the app doesn't crash ?
EDIT: I edited the code, the if block is not optimised out:
int j = 2;
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_5_1) {
j++; //This is just some code so I can use breakpoints for testing.
NSLog(#"Google Mobile Ads SDK version: %#", [GADRequest sdkVersion]); //Commenting out the line prevents the crash
}else{
j--;
}
NSLog(#"%d",j);
The output is "1", so the code in the else block executes. So even thought the function call [GADRequest sdkVersion] is not made, why does it crash ? Again, if I comment out the function call the app does not crash.
One possibility that is consistent with what you're describing is that linking to AdMob causes the crash. Sending a message to the GADRequest class in your code causes it to link to the GADRequest class, whereas if you didn't, it wouldn't link to it.
Why does linking to AdMob cause the crash? Most likely it's because AdMob links to several system frameworks, some of which may not exist on iOS 5 (e.g. AdSupport framework), so when it tries to dynamically link to them on app startup, the dynamic linker crashes.
I'm not sure what you can do. Maybe you can try explicitly linking to the system frameworks that AdMob use as "optional" in Xcode? (I haven't tested it.)
Otherwise, you could downgrade to a version of AdMob that supports iOS 5 (according to the release notes, any version before 7 should do).
I dont know why it crashes - but don't support iOS 5. It is pointless. The iOS market split is something like 20% iOS7, 80% iOS8. You cannot buy iOS5 phones, and you cannot install or, or even release apps for it.

FB ios SDK 3.13.1 The operation couldn't be completed (com.facebook.sdk error 2)

I have been using FB iOS SDK 3.13.1 in my app and Login is working fine until I setup facebook account in Settings->Facebook. I couldn't login using FB at all. It was kept giving me error :The operation couldn't be completed (com.facebook.sdk error 2)
I tried all suggestions mentioned on stackoverflow. Changing facebook app settings or handle openURL but none worked.
But If I removed account from settings->facebook. Login worked. So I did setup all things correctly as instructed.
Not sure, what's wrong but I think FB SDK is very unstable.
Solved. after lot of searching and tries, I realized its just issue with Facebook ios SDK. Hence upgraded to 3.14.1 and its working fine. I even tried to reproduce the issue with an older build and try same scenario number of times.

Resources