diff --git a/xcode/OLMKit.xcodeproj/project.pbxproj b/xcode/OLMKit.xcodeproj/project.pbxproj
index 0ec7587158343e2917ee47833144dc2c4061327a..a3b636fa53bd3e0c5368bfe30ed70f3937ddadd7 100644
--- a/xcode/OLMKit.xcodeproj/project.pbxproj
+++ b/xcode/OLMKit.xcodeproj/project.pbxproj
@@ -182,7 +182,7 @@
 		3274F5EF1D9A633A005282E4 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 0800;
+				LastUpgradeCheck = 0810;
 				ORGANIZATIONNAME = matrix.org;
 				TargetAttributes = {
 					3274F5F71D9A633A005282E4 = {
@@ -273,7 +273,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run \'pod install\' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n";
+			shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n";
 			showEnvVarsInLog = 0;
 		};
 		793D0533290528B7C0E17CAD /* [CP] Copy Pods Resources */ = {
@@ -303,7 +303,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run \'pod install\' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n";
+			shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n";
 			showEnvVarsInLog = 0;
 		};
 /* End PBXShellScriptBuildPhase section */
@@ -354,6 +354,7 @@
 				CLANG_WARN_INFINITE_RECURSION = YES;
 				CLANG_WARN_INT_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
 				CLANG_WARN_SUSPICIOUS_MOVES = YES;
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -405,6 +406,7 @@
 				CLANG_WARN_INFINITE_RECURSION = YES;
 				CLANG_WARN_INT_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
 				CLANG_WARN_SUSPICIOUS_MOVES = YES;
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
diff --git a/xcode/OLMKit/OLMSession.m b/xcode/OLMKit/OLMSession.m
index a47deb191ec648bde87b0900fcf3a667886868a7..eee65a95a4208da58ec7d11c1e0eb2df83343ef3 100644
--- a/xcode/OLMKit/OLMSession.m
+++ b/xcode/OLMKit/OLMSession.m
@@ -156,6 +156,41 @@
     return idString;
 }
 
+- (BOOL)matchesInboundSession:(NSString *)oneTimeKeyMessage {
+    NSData *otk = [oneTimeKeyMessage dataUsingEncoding:NSUTF8StringEncoding];
+
+    size_t result = olm_matches_inbound_session(_session, otk.bytes, otk.length);
+    if (result == 1) {
+        return YES;
+    }
+    else {
+        if (result == olm_error()) {
+            const char *error = olm_session_last_error(_session);
+            NSLog(@"olm_matches_inbound_session error: %s", error);
+        }
+        return NO;
+    }
+}
+
+- (BOOL)matchesInboundSessionFrom:(NSString *)theirIdentityKey oneTimeKeyMessage:(NSString *)oneTimeKeyMessage {
+    NSData *idKey = [theirIdentityKey dataUsingEncoding:NSUTF8StringEncoding];
+    NSData *otk = [oneTimeKeyMessage dataUsingEncoding:NSUTF8StringEncoding];
+
+    size_t result = olm_matches_inbound_session_from(_session,
+                                                     idKey.bytes, idKey.length,
+                                                     otk.bytes, otk.length);
+    if (result == 1) {
+        return YES;
+    }
+    else {
+        if (result == olm_error()) {
+            const char *error = olm_session_last_error(_session);
+            NSLog(@"olm_matches_inbound_session error: %s", error);
+        }
+        return NO;
+    }
+}
+
 - (OLMMessage*) encryptMessage:(NSString*)message error:(NSError**)error {
     size_t messageType = olm_encrypt_message_type(_session);
     size_t randomLength = olm_encrypt_random_length(_session);
diff --git a/xcode/OLMKitTests/OLMKitTests.m b/xcode/OLMKitTests/OLMKitTests.m
index 251c90ed9748165707ac95855c3534e1326d49f2..1adbde296e31b5168b8a3a89102f2d1af61684ad 100644
--- a/xcode/OLMKitTests/OLMKitTests.m
+++ b/xcode/OLMKitTests/OLMKitTests.m
@@ -52,6 +52,15 @@
     NSString *plaintext = [bobSession decryptMessage:aliceToBobMsg error:&error];
     XCTAssertEqualObjects(message, plaintext);
     XCTAssertNil(error);
+
+    XCTAssert([bobSession matchesInboundSession:aliceToBobMsg.ciphertext]);
+    XCTAssertFalse([aliceSession matchesInboundSession:@"ARandomOtkMessage"]);
+
+    NSString *aliceIdKey = alice.identityKeys[@"curve25519"];
+    XCTAssert([bobSession matchesInboundSessionFrom:aliceIdKey oneTimeKeyMessage:aliceToBobMsg.ciphertext]);
+    XCTAssertFalse([bobSession matchesInboundSessionFrom:@"ARandomIdKey" oneTimeKeyMessage:aliceToBobMsg.ciphertext]);
+    XCTAssertFalse([bobSession matchesInboundSessionFrom:aliceIdKey oneTimeKeyMessage:@"ARandomOtkMessage"]);
+
     BOOL success = [bob removeOneTimeKeysForSession:bobSession];
     XCTAssertTrue(success);
 }
@@ -96,8 +105,6 @@
     XCTAssertEqualObjects(msg1, dMsg1);
     XCTAssertEqualObjects(msg2, dMsg2);
     XCTAssertEqualObjects(msg3, dMsg3);
-
-    
 }
 
 - (void) testAccountSerialization {
diff --git a/xcode/Podfile.lock b/xcode/Podfile.lock
index 3ac110a13c92512e26ac502723c518cf5819e19c..2d69849f57d0faaee0b8970d1e07416ebb41f965 100644
--- a/xcode/Podfile.lock
+++ b/xcode/Podfile.lock
@@ -13,7 +13,7 @@ EXTERNAL SOURCES:
     :path: ../OLMKit.podspec
 
 SPEC CHECKSUMS:
-  OLMKit: ed17cdf7695bc0de1e2bf98243eb65f5b9ddebc1
+  OLMKit: 5f2894a210ca99ad17128af4fd3beeeeb0eca404
 
 PODFILE CHECKSUM: 4e261dae61d833ec5585ced2473023b98909fd35