Code Monkey home page Code Monkey logo

azure-iot-samples-ios's Introduction

page_type languages products description
sample
swift
azure
azure-iot-hub
A set of easy-to-understand, continuously-tested samples for connecting to Azure IoT Hub via Azure/azure-iot-sdk-c/CocoaPod.

Azure IoT Samples for iOS Platform

azure-iot-samples-iot provides a set of easy-to-understand, continuously-tested samples for connecting to Azure IoT Hub via Azure/azure-iot-sdk-c/CocoaPod

Getting Started

Prerequisites

  • The latest version of XCode, running the latest version of the iOS SDK. This quickstart was tested with XCode 9.3 and iOS 11.3.
  • The latest version of CocoaPods.

Quickstart

CocoaPods

Resources

azure-iot-samples-ios's People

Contributors

ericwol-msft avatar jbobotek avatar microsoftopensource avatar msftgits avatar philmea avatar supernova-eng avatar yzhong94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-iot-samples-ios's Issues

Reqeust Azure IoT Service-Client iOS Sample

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful

Hi,
I am developing an iOS app for Azure IoT.
But I can't find the service client sample for iOS.
The functions I need are getting reported property of Device Twin, sending/receiving Direct Method, etc.
I hope for a quick response.
Regards,
Live


Thanks! We'll be in touch soon.

'azure_c_shared_utility/gballoc.h' file not found

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Download the sample, run pod install and try to build the workspace

Any log messages given by the failure

The error above shows
'azure_c_shared_utility/gballoc.h' file not found

Expected/desired behavior

The project compiles and runs

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
macOS Catalina

Versions

XCode 11.1

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Connection not accepted

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Opened the MQTTsample in local machine and add my iot hub connection string and started the telemetry data to iot hub.

Any log messages given by the failure

2019-04-06 17:01:00.722624-0400 MQTT Client Sample[16359:137416] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.
Error: Time:Sat Apr 6 17:01:21 2019 File:/Users/a.391160/Documents/Code-Lab/iOS/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTHubClient/iothub_client/src/iothubtransport_mqtt_common.c Func:mqtt_operation_complete_callback Line:1456 Connection Not Accepted: 0x5: Not Authorized
Error: Time:Sat Apr 6 17:01:30 2019 File:/Users/a.391160/Documents/Code-Lab/iOS/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTHubClient/iothub_client/src/iothubtransport_mqtt_common.c Func:mqtt_operation_complete_callback Line:1456 Connection Not Accepted: 0x5: Not Authorized
Error: Time:Sat Apr 6 17:01:39 2019 File:/Users/a.391160/Documents/Code-Lab/iOS/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTHubClient/iothub_client/src/iothubtransport_mqtt_common.c Func:mqtt_operation_complete_callback Line:1456 Connection Not Accepted: 0x5: Not Authorized

Expected/desired behavior

The app should connect to IoT Hub and send the telemetry data.

OS and Version?

macOS ( Sierra)

Versions

Xcode 10.2

Mention any other details that might be useful

My Connection string format is connectionString ="HostName=myIoThubHostName;DeviceId=MyDeviceID;SharedAccessKey=MySharedAccessKey"
IoT hub is using x509 self signed certificate.
Connection string with following modification is working fine in Android.
connectionString ="HostName=myIoThubHostName;DeviceId=MyDeviceID;SharedAccessKey=MySharedAccessKey;x509=true"
Method name DeviceClient(connectionString, protocol, publicKey, false, privateKey, false);


Thanks! We'll be in touch soon.

Where to find source used for building cocoapods (.podspec)


This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Can't find .podspec. Here is the link to .json:
https://github.com/CocoaPods/Specs/blob/master/Specs/3/8/4/AzureIoTHubClient/1.2.4/AzureIoTHubClient.podspec.json
But it is the compiled version
The original one is in ruby. Where we can find link to it?

Expected/desired behavior

If it's open source project where is .podspec file?

OS and Version?

iOS
Versions 13.3

We are trying to port lib for iOS to work on watchOS. .podspec will be helpfull.
Where to find source used for building cocoapods (.podspec) for using AureIoTHub for iOS?
https://github.com/Azure/azure-iot-sdk-c/blob/master/iothub_client/samples/ios/CocoaPods.md


EXC_BAD_ACCESS error when running sample with MQTT_Protocol and AMQP_Protocol

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Running the sample of device with both MQTT and AMQP will crash with EXC_BAD_ACCESS at same function dowork_send(TLS_IO_INSTANCE* tls_io_instance)

Minimal steps to reproduce

Just run the sample of device.

Any log messages given by the failure

No log. Both are EXC_BAD_ACCESS.

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

macOS High Sierra 10.13.6 (17G65)

Mention any other details that might be useful

#1 0x00000001033b912d in dowork_send at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTUtility/pal/ios-osx/tlsio_appleios.c:474
#2 0x00000001033b8b4e in tlsio_appleios_send_async at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTUtility/pal/ios-osx/tlsio_appleios.c:700
#3 0x00000001033c3960 in xio_send at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTUtility/src/xio.c:151
#4 0x0000000103471e4e in sendPacketItem at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTuMqtt/src/mqtt_client.c:339
#5 0x0000000103471cc9 in mqtt_client_publish at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTuMqtt/src/mqtt_client.c:1037
#6 0x0000000103312625 in publish_mqtt_telemetry_msg at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTHubClient/iothub_client/src/iothubtransport_mqtt_common.c:837
#7 0x0000000103311866 in IoTHubTransport_MQTT_Common_DoWork at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTHubClient/iothub_client/src/iothubtransport_mqtt_common.c:2704
#8 0x000000010332013d in IoTHubTransportMqtt_DoWork at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTHubClient/iothub_client/src/iothubtransportmqtt.c:115
#9 0x00000001032e8d3e in IoTHubClient_LL_DoWork at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/Pods/AzureIoTHubClient/iothub_client/src/iothub_client_ll.c:1338
#10 0x0000000102fc1309 in ViewController.dowork() at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/MQTT Client Sample/ViewController.swift:122
#11 0x0000000102fc1334 in @objc ViewController.dowork() ()
#12 0x00000001035154dd in __NSFireTimer ()
#13 0x00000001043a5e64 in CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION ()
#14 0x00000001043a5a52 in __CFRunLoopDoTimer ()
#15 0x00000001043a560a in __CFRunLoopDoTimers ()
#16 0x000000010439ce4c in __CFRunLoopRun ()
#17 0x000000010439c30b in CFRunLoopRunSpecific ()
#18 0x000000010a087a73 in GSEventRunModal ()
#19 0x00000001048930b7 in UIApplicationMain ()
#20 0x0000000102fc92c7 in main at /Users/ltp1994/Development/azure-iot-samples-ios/quickstart/sample-device/MQTT Client Sample/AppDelegate.swift:7

There are stack of function


Thanks! We'll be in touch soon.

iOS 14 unrecognized selector sent to instance exception on IoTHubClient_LL_DoWork()

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Call IoTHubClient_LL_DoWork(iotHubClientHandle)

Reference issue: Azure/azure-iot-sdk-c#1624

It seems that it is possible to fix this issue by changing the IoTHubClient_LL_DoWork within the SDK, but I was wondering if this fix will come soon in the Cocoapod.

Best regards!

send cloud-to-device message example on iOS

Hi,

Can I get the cloud-to-device message example source code from the iPhone in the link page below?

[https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-ios-swift-c2d]
cloud-to-device message

AzureIoTHubClient wrapper framework could not build module

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Step 1: Create a framework project using Xcode (I used Xcode 12.4)
Step 2: Set up cocoapods
Step 3: Add Azure IoT related pods in the pod file
Step 4: Do pod install
Step 5: Add podspec for the project with Azure IoT dependency
Step 6: Create a Swift file and import AzureIoTHubClient
Step 7: Create an iPhone application project
Step 8: Setup cocoapods
Step 9: Add the above framework pod in the pod file
Step 10: Do pod install
Step 11: Build the iPhone application project

Any log messages given by the failure

Could not build Objective-C module 'AzureIoTHubClient' Header 'agenttypesystem.h' not found
Skipping 'agenttypesystem.h' because module declaration of 'AzureIoTHubClient' lacks the 'framework' qualifier

Expected/desired behavior

Framework and iPhone application project should build successfully

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Catalina

Versions

10.15.7

Mention any other details that might be useful

Please refer this SO question which I have posted.


Thanks! We'll be in touch soon.

Socket SO_ERROR [54: Connection reset by peer]

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Running the sample "sample-service", send a C-to-D message, and "Connection reset by peer" shows after about 6 minutes later

Any log messages given by the failure

2019-08-13 09:32:37.602653+0800 AzureIoTServiceSample[19822:1281274] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/po-hsunlin/Library/Developer/CoreSimulator/Devices/1EE2824C-BCC7-4149-89C9-371D18EB7E90/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2019-08-13 09:32:37.611916+0800 AzureIoTServiceSample[19822:1281274] [MC] Reading from private effective user settings.
2019-08-13 09:33:01.645498+0800 AzureIoTServiceSample[19822:1281274] [Common] _BSMachError: port 8a03; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"
2019-08-13 09:33:02.078740+0800 AzureIoTServiceSample[19822:1281274] [Common] _BSMachError: port 8a03; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"
2019-08-13 09:33:02.079114+0800 AzureIoTServiceSample[19822:1281274] [Common] _BSMachError: port 8a03; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"
In openIotHub messaging
2019-08-13 09:38:22.191755+0800 AzureIoTServiceSample[19822:1281543] [] nw_socket_handle_socket_event [C1.1:1] Socket SO_ERROR [54: Connection reset by peer]

Expected/desired behavior

connection stays alive, and the iOS device should be able to send another c-to-d message

OS and Version?

macOS (Mojave)

Versions

10.14.6

Mention any other details that might be useful


Thanks! We'll be in touch soon.

CFNetwork SSLHandshake failed (-9807)

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

I have had an application running since January on IOS sending telemetry data from IOS devices to IOT Hub. Recently, first noticed with the March 25th release of the IOS update the connection from IOS to the Azure IOT Hub is showing an error on connection and is waiting for the ssl certificate. I have test all Microsoft IOS examples and all seem to exhibit the same behavior.

Reproducible with IOS example found in the following repos:

https://github.com/Azure/azure-iot-sdk-c/tree/master/iothub_client/samples/ios

https://github.com/Azure-Samples/azure-iot-samples-ios.git

MacOS:
10.14.4

Xcode:
10.2

IOS:
12.2

Output Logs:

2019-04-15 08:01:25.903908-0400 MQTT Client Sample[601:61983] CFNetwork SSLHandshake failed (-9807)
2019-04-15 08:01:25.903963-0400 MQTT Client Sample[601:61983] TCP Conn 0x283249f80 SSLHandshake failed (-9807)
Error: Time:Mon Apr 15 08:01:25 2019 File:/Users/gvigelet/Downloads/azure-iot-samples-ios-master/quickstart/sample-device/Pods/AzureIoTUtility/pal/ios-osx/tlsio_appleios.c Func:dowork_read Line:447 Communications error while reading

2019-04-15 08:01:31.915574-0400 MQTT Client Sample[601:61983] CFNetwork SSLHandshake failed (-9807)
2019-04-15 08:01:31.915670-0400 MQTT Client Sample[601:61983] TCP Conn 0x283249ec0 SSLHandshake failed (-9807)
Error: Time:Mon Apr 15 08:01:31 2019 File:/Users/gvigelet/Downloads/azure-iot-samples-ios-master/quickstart/sample-device/Pods/AzureIoTUtility/pal/ios-osx/tlsio_appleios.c Func:dowork_read Line:447 Communications error while reading

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.