FBSDKShareAPI share not visible on test user - ios

So, I'm using Facebook share sdk on iOS and just want to share example stuff via test user. I'm logged in with permissions:
loginButton.publishPermissions = ["publish_actions"]
loginButton.readPermissions = ["public_profile", "email", "user_friends", "user_likes"]
And I'm making share like this:
let action = FBSDKShareOpenGraphAction()
action.actionType = "og.likes"
action.setString("http://samples.ogp.me/226075010839791", forKey: "object")
let content = FBSDKShareOpenGraphContent()
content.action = action
content.previewPropertyName = "object"
let shareAPI = FBSDKShareAPI()
shareAPI.delegate = self
shareAPI.shareContent = content
let shared = shareAPI.share()
print("shared: \(shared)")
I'm getting following result:
shared: true
didCompleteWithResults [postId: 122321171486204,
completionGesture: post]
Looks like it's working, right? But then I log in that account and cannot see a thing. It's stated: "No posts to see". Also this account has friends and they cannot see anything too.
Why is that so?

Related

Hide URL when sending with email

I am developing iOS app that sending selected pdfs(urls) stored in firebase with using SMTP. I don't want to be seen urls in mail.
It should be like this "https://...." = "Document1 or proper name"
Is it possible ?
func sendEmail() {
let message = SKPSMTPMessage()
message.relayHost = "smtp.gmail.com"
message.login = "****#gmail.com"
message.pass = "*****"
message.requiresAuth = true
message.wantsSecure = true
message.relayPorts = [587]
message.fromEmail = "****#gmail.com"
message.toEmail = "****#gmail.com"
message.subject = "subject"
let messagePart = [kSKPSMTPPartContentTypeKey: "text/plain; charset=UTF-8", kSKPSMTPPartMessageKey: "Hi,\n\n Please see the requested documents below\n\n\(getmailpdf.joined(separator: "\n\n\n"))"]
message.parts = [messagePart]
message.delegate = self
message.send()
}

Sign any message with the user’s private key and verify the signature on Ethereum

I'm trying to explore Ethereum and creating a app which let user sign message and validate the message.
I'm using web3swift framework for this and what I have tried so far is as follows -
let web3Rinkeby = Web3.InfuraRinkebyWeb3()
let msgStr = "This is my first Ethereum App";
let data = msgStr.data(using: .utf8)
let signMsg = web3Rinkeby.wallet.signPersonalMessage(data!, account: address);
print(signMsg);
but I'm not sure if this is right and how to validate any message as well. Please help.
Seems, that you didn't specify exact address.
Here is an example:
let web3Rinkeby = Web3.InfuraRinkebyWeb3()
///
let keystore = try! EthereumKeystoreV3(password: "")
let keystoreManager = KeystoreManager([keystore!])
web3Rinkeby.addKeystoreManager(keystoreManager)
let address = keystoreManager.addresses![0]
///
let msgStr = "This is my first Ethereum App";
let data = msgStr.data(using: .utf8)
let signMsg = web3Rinkeby.wallet.signPersonalMessage(data!, account: address);
print(signMsg);
Here is an example, how to sign transactions in the tests of the project:

PKPaymentAuthorizationViewController(paymentRequest: requestObject) is returning nil

I am facing a problem in initilizing PKPaymentAuthorizationViewController returning nil in one of the device.
The device region is set to UK and I have added a UK issued card in the Apple Wallet.
The PKPaymentRequest is configured as following:
let request = PKPaymentRequest()
request.merchantIdentifier = "mymerchantid"
request.supportedNetworks = [PKPaymentNetworkVisa, PKPaymentNetworkMasterCard, PKPaymentNetworkAmex]
request.merchantCapabilities = PKMerchantCapability.Capability3DS
request.countryCode = "US"
request.currencyCode = "USD"
let price: <NSDecimalNumber>
let item : PKPaymentSummaryItem = PKPaymentSummaryItem(label: "amount", amount: price, type: .Pending)
request.paymentSummaryItems = [
item
]
let paymentAuthorizationVC = PKPaymentAuthorizationViewController(paymentRequest: request) // Returning Nil
if PKPaymentAuthorizationViewController.canMakePaymentsUsingNetworks(SupportedPaymentNetworks) // Returns true
Device: iPhone 6
OS: 10.2.2
Note: Same Card is onboared in another device for the same App its working fine.
Tried as mentioned in the below link and few other blogs- no luck
Apple pay PKPaymentauthorizationViewController always returning nil when loaded with Payment request
Looking for suggestions.
I had this same problem and the cause was using a Discover card for testing when it's not included as a supported payment network. Make sure that you are passing in all the credit card types that your user base will possibly use.
Try changing this line:
request.supportedNetworks = [PKPaymentNetworkVisa, PKPaymentNetworkMasterCard, PKPaymentNetworkAmex]
To the following:
request.supportedNetworks = [PKPaymentNetworkVisa, PKPaymentNetworkMasterCard, PKPaymentNetworkAmex, PKPaymentNetwork.discover]
In Swift3, The declaration for PKPaymentAuthorizationViewController init() is not defined as optional, even though it does return nil when it fails.

Adding new Records to Firebase database using email of user on IOS swift Xcode

i am trying to add a new record for every user who has registered on my application using their email not uid,
this is the code i have is using uid. any suggestions?
let ref = FIRDatabase.database().reference()
ref.child("users/(user.uid)/Experience").setValue(experience)
ref.child("users").child(user!.uid).setValue(["displayName": name])
ref.child("users").child(user!.uid).setValue(["Number": number])
ref.child("users").child(user!.uid).setValue(["Age": age])
ref.child("users").child(user!.uid).setValue(["Height": height])
ref.child("users").child(user!.uid).setValue(["Experience": experience])
let email = FIRAuth.auth()?.currentUser?.email
let userCurrently = FIRAuth.auth()?.currentUser
let emailQueried = userCurrently?.email

TouchID with KeyChain - Enter Passcode screen appears malformed (Swift)

I am having a hard time with this one:
Our app uses TouchID to retrieve secrets from the KeyChain that are used to authenticate to a WebApp in a WKWebView. All is fine when the user successfully authenticates with TouchID.
The problem arises when the user fails TouchID and then taps on "Enter Passcode" to authenticate via device passcode instead. I noticed that the screen that gets presented is plain white, and the passcode text-box does not show a value for the last character entered until it is masked, creating a strange user experience. This seems like a bug to me, unless I am somehow missing a configuration requirement.
// global arguments for the touchId keychain queries
let kSecClassValue = NSString(format: kSecClass)
let kSecAttrAccountValue = NSString(format: kSecAttrAccount)
let kSecValueDataValue = NSString(format: kSecValueData)
let kSecClassGenericPasswordValue = NSString(format: kSecClassGenericPassword)
let kSecAttrServiceValue = NSString(format: kSecAttrService)
let kSecMatchLimitValue = NSString(format: kSecMatchLimit)
let kSecReturnDataValue = NSString(format: kSecReturnData)
let kSecMatchLimitOneValue = NSString(format: kSecMatchLimitOne)
let kSecAttrAccessControlValue = NSString(format: kSecAttrAccessControl)
let kSecUseOperationPromptValue = NSString(format: kSecUseOperationPrompt)
// set access control
let accessControl = SecAccessControlCreateWithFlags(kCFAllocatorDefault,
kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, .UserPresence, nil)
// Instantiate a new default keychain query
// Tell the query to return a result
// Limit our results to one item
var keychainQuery: NSMutableDictionary = NSMutableDictionary(objects: [kSecClassGenericPasswordValue, service, userAccount, kCFBooleanTrue, kSecMatchLimitOneValue, "Place your finger to authenticate.", accessControl.takeUnretainedValue()], forKeys: [kSecClassValue, kSecAttrServiceValue, kSecAttrAccountValue, kSecReturnDataValue, kSecMatchLimitValue, kSecUseOperationPromptValue, kSecAttrAccessControlValue])
var dataTypeRef :Unmanaged<AnyObject>?
// Search for the keychain item
touchIdStatusCode = SecItemCopyMatching(keychainQuery, &dataTypeRef)
Here is the generated keychainQuery dictionary:
{
"accc" = "<SecAccessControlRef: 0x170621140>";
"acct" = “MY_ACCOUNT”;
"class" = genp;
"m_Limit" = "m_LimitOne";
"r_Data" = 1;
"svce" = “MY_SERVICE”;
"u_OpPrompt" = "Place your finger to authenticate.";
}
This behavior exists on the latest iOS version (8.4). Here is the screen I was referring to:
My question is: Am I somehow causing the screen to be broken by the way I am invoking TouchID? Or is this perfectly normal for this scenario?
Thanks, and sorry for the lengthy post!
The issue described is a bug that was confirmed by Apple engineers. It still exists as of iOS 9.0.2.

Resources