Giter Site home page Giter Site logo

agorartm_ios's People

Contributors

agorabuilder avatar maxxfrazer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

agorartm_ios's Issues

Could not build for arm64.

Hi I am using a M1 macbook and XCode 13.2.1 (13C100)

I am getting Build failed with this error message
undefined symbols for architecture arm64: "OBJC_CLASS$_AgoraRtmSendMessageOptions"
undefined symbols for architecture arm64: "OBJC_CLASS$_AgoraRtmKit"

I tried adding arm64 to the excluded architectures for any simulator build but then I am getting a different error from different package - "Alamofire" , it could not find files x86_64 architecture.
Now I can not exclude arm64 in build settings so as to make Alamofire work. Any idea what else I can modify so as make Agora build error go away?

Can't build for iOS Simulator on M1

Hello, I still can't build for iOS Simulator on M1 with the latest 1.4.10 version. Tried adding arm64 to excluded architectures on xcode project and podfile. Getting the error all the same. Works fine on physical devices.

iOS 15.5, XCode 13.4.1

ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Users/user/app/ios/Pods/AgoraRtm_iOS/AgoraRtmKit.framework/AgoraRtmKit' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When use SPM it not work...

Error message...

dyld: Library not loaded: @rpath/AgoraRtmKit.framework/AgoraRtmKit
  Referenced from: /private/var/containers/Bundle/Application/C5C87A3A-6021-4E91-AB0A-49D1050E6CB5/Lit Live.app/Lit Live
  Reason: image not found
dyld: launch, loading dependent libraries
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

Missing visionOS support for SPM

As the title explains, AgoraRTM cannot be used in a native visionOS app. I can imagine this would be as simple as adding .visionOS(.v1) to the platform field in the Package.swift.

AgoraRtmChannelDelegate is not called

Greetings,

I ran this app demo and no members were showing up in the list after signing on. I took the code and modified it a bit for my own app for messaging and I can successful log into the rtm service and get a successful error response (code 0) when sending a message. The issue is the delegate is not called for either item. I am using the latest RTM version 1.4.10. Below is a sample of my code :

import SwiftUI
import AgoraRtmKit
import AgoraRtcKit

struct UserData: Codable {
    var rtmId: String
    var rtcId: UInt
    var username: String
    func toJSONString() throws -> String? {
        let jsonData = try JSONEncoder().encode(self)
        return String(data: jsonData, encoding: .utf8)
    }
}

class AgoraObservable: NSObject, ObservableObject {

    @Published var chatMessages: [ChatMessage] = []
    var channel: AgoraRtmChannel?
    @Published var channelName: String = "test"
    @Published var agoraSessionToken = "0061537aa75dc534ada816eb808742d17c4IAA1r7RGzcXe/ZnDKEeLOCNnUuD0O4WOpz+TQ0fC9Aoiawx+f9gAAAAAEAC3KIpZy8BuYgEAAQDLwG5i"
    @Published var username: String = ""
    @Published var members: [String] = []
    @Published var membersLookup: [String: (rtcId: UInt, username: String)] = [:] {
        didSet {
            members = self.membersLookup.values.compactMap {
                $0.username + (
                    $0.rtcId == self.rtcId ? " (Me)" : ""
                )
            }
        }
    }

    var rtcId: UInt = 0
    var rtmId = "test"
    var rtmIsLoggedIn = false

    
    lazy var rtckit: AgoraRtcEngineKit = {
        let engine = AgoraRtcEngineKit.sharedEngine(
            withAppId: "<#App ID#>", delegate: nil
        )
        engine.setChannelProfile(.liveBroadcasting)
        engine.setClientRole(.broadcaster)
        return engine
    }()

    lazy var rtmkit: AgoraRtmKit? = {
        let rtm = AgoraRtmKit(
            appId: "1537aa75dc534ada816eb808742d17c4", delegate: self
        )
        return rtm
    }()
}
extension AgoraObservable {
    func joinChannel() {
        if !self.rtmIsLoggedIn {
            rtmkit?.login(byToken: self.agoraSessionToken, user: self.rtmId) { loginResponse in
                if loginResponse != .ok {
                    fatalError("Could not log in to RTM")
                }
                print("Successfully logged into rtm")
                self.rtmIsLoggedIn = true
                self.joinChannel()
            }
            return
        }

            self.channel = self.rtmkit?.createChannel(withId: self.channelName, delegate: self)
            self.channel?.join(completion: { joinStatus in
                if joinStatus == .channelErrorOk {
                    print("Successfully joined channel")
                    print(self.channel)
                    
                } else {
                    
                    print(joinStatus)
                    
                    self.channel = nil
                    
                }
            })
    }
}

extension AgoraObservable: AgoraRtmChannelDelegate, AgoraRtmDelegate {
    func channel(_ channel: AgoraRtmChannel, memberJoined member: AgoraRtmMember) {
        print("Agora member: \(member.userId)")
    }

    func channel(_ channel: AgoraRtmChannel, messageReceived message: AgoraRtmMessage, from member: AgoraRtmMember) {
        print("Message received from: \(member.userId)")
        
        print(message)
        
        var color = Color.gray
        var isMe = false
        if member.userId == UIDevice.current.name {
            color = Color.blue
            isMe = true
        }
        let newMessage = ChatMessage(message: message.text, avatar: member.userId, color: color, isMe: isMe)
        
        chatMessages.append(newMessage)
        
        //parseMemberData(from: message.text)
    }
    func rtmKit(_ kit: AgoraRtmKit, messageReceived message: AgoraRtmMessage, fromPeer peerId: String) {
        parseMemberData(from: message.text)
    }

    func parseMemberData(from text: String) {
        guard let textData = text.data(using: .utf8),
              let decodedUserData = try? JSONDecoder().decode(UserData.self, from: textData)
        else {
            return
        }
        membersLookup[decodedUserData.rtmId] = (decodedUserData.rtcId, decodedUserData.username)
    }
    func channel(_ channel: AgoraRtmChannel, memberLeft member: AgoraRtmMember) {
        membersLookup.removeValue(forKey: member.userId)
    }
}

Any help would be greatly appreciated!

1.5.1 is using openSSL v1.1.1h that vulnerable to CVE-2023-0286

I know the stable version 1.5.1 is released before the vulnerability CVE-2023-0286 is discovered. But my company requests us to have no high risk vulnerability included in the app.

Just change the OpenSSL version to v1.1.1t should be able to solve this problem, but I can only get a binary version of this library, is it any way to build my own version? I cannot find any source code in this repository. Can anyone give me a guide so I can build my own one with only OpenSSL version changed.

Or if the unstable 2.x are compatible to the 1.5.1, I can also try them.

Not able to login via SwiftUI app

I have been trying to implement RTM in a SwiftUI app but it keeps giving me an error code 3. Below is the code I am currently using (I instantiate the class as a @StateObject and pass the instance back to represent the rtm and channel delegates)..

`class AgoraChatOO: NSObject, ObservableObject {

@Published var chatMessages: [ChatMessage] = []
@Published var kit: AgoraRtmKit?
@Published var rtmChannel: AgoraRtmChannel?

func updateKit(appId: String, delegate: AgoraRtmDelegate, channelDelegate: AgoraRtmChannelDelegate) {
    
        kit = AgoraRtmKit(appId: appId, delegate: delegate)
    
        
        guard let kit = kit else { return }
     
    kit.login(byToken: "my_tokeni", user: UIDevice.current.name) { [unowned self] (error) in
        
            if error != .ok {
                print("Error logging in: ", error.rawValue)
            } else {
                self.rtmChannel = kit.createChannel(withId: "testChannel", delegate: channelDelegate)
                
                self.rtmChannel?.join(completion: { (error) in
                    if error != .channelErrorOk {
                        print("Error joining channel: ", error.rawValue)
                    }
                })
            }
        }
    }

}`

Privacy Manifest

Starting from May 1st, Privacy Manifest files will become mandatory. All the SDKs used in our app needs to incorporate the xcprivacy manifest.
Reference: https://developer.apple.com/news/?id=3d8a9yyh

We require the iOS SDK version of xcprivacy manifest that is compatible with the xcprivacy manifest.

Do we need to add APIs such as System Boot Time API, File Timestamp API and Disk Space API, which are among the Privacy Accessed API Types that Apple requires us to declare, to our own Privacy Manifest file even if we don't use them but Agora does? Or is it sufficient for them to be added to the library's privacy manifest by your team when the Agora library is updated to avoid rejection by Apple?

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.